package contains methods to upload images to the Capella Server
go get https://github.com/codex-team/capella.go
import(
"github.com/codex-team/capella.go"
)
func main() {
// upload image from URL
url := "imageUrl"
response, err := capella.Upload(url)
if err != nil {
// handle or panic
}
....
// upload image from local path
filepath := "~/images/file.png"
response, err := capella.UploadFile(filepath)
if err != nil {
// handle or panic
}
}
response implements capella.Response struct that has
success
, message
, id
, url
success
is true
when CodeX capella saved the image
url
- special allocated URL for uploaded image. If success
is false
this propery
takes value of nil
message
- in case of error you will get a message.
CodeX Capella documentation
Feel free to aks a question, report a bug or fork and improve a package