Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wisdomenigma/algolia-media
https://github.com/wisdomenigma/algolia-media
golang
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/wisdomenigma/algolia-media
- Owner: WisdomEnigma
- License: mpl-2.0
- Created: 2022-08-29T04:51:37.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-13T21:56:09.000Z (8 months ago)
- Last Synced: 2024-06-20T12:04:44.286Z (5 months ago)
- Topics: golang
- Language: Go
- Homepage:
- Size: 10.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Algolia-media
Algolia media is a wrapper library which is used to store media files. Algolia provide link to store data on data base, which is good methodology , however I want to store media files in decode form. Later programmer will encode the data and used in applicaton.
# Example
file, err := os.OpenFile("metamask.png", os.O_RDWR|os.O_CREATE, 0755)
if err != nil {
return
}wrapper := algolia_wrapper.NewAlgolia_Object(file)
client := wrapper.ToConnectAlgolia(&protos.Credentials{
APP_Code: "...",
Algolia_AMI: "...",
})index := wrapper.Index(client, []string{"MyAvatar"}...)
object, err := wrapper.Put(index)
if err != nil {
log.Println("Error putting image:", err)
return
}result, err := wrapper.Query(index, object, []string{"MyAvatar"}...)
if err != nil {
log.Println("Error finding image :", err)
return
}log.Println("Result:", result.Query)
resultSet, decode , err := wrapper.Get(index, object)
if err != nil {
log.Println("Error getting image:", err)
return
}log.Println("Metadata :", resultSet, "Decode:", decode[0:20])