go-gyazo is a library for Go for accessing the Gyazo API.
Use go get
:
$ go get -d github.com/tomohiro/go-gyazo
Import this package like this:
import "github.com/tomohiro/go-gyazo/gyazo"
Create a client with your Gyazo access token:
gyazo, err := gyazo.NewClient("your access token")
if err != nil {
panic(err)
}
list, _ := gyazo.List(&gyazo.ListOptions{Page: 1, PerPage: 50})
fmt.Println(list.Meta.TotalCount) // Total count of specified user's images
for _, img := range *list.Images {
fmt.Println(img.PermalinkURL) // http://gyazo.com/8980c52421e452ac3355ca3e5cfe7a0c
}
file, _ := os.Open("/your/image/file.png")
defer file.Close()
image, _ := gyazo.Upload(file)
fmt.Println(image.PermalinkURL) // http://gyazo.com/8980c52421e452ac3355ca3e5cfe7a0c
result, _ := gyazo.Delete("8980c52421e452ac3355ca3e5cfe7a0c")
For complete usage of go-gyazo, see the full package docs.
Please check out the CONTIRBUTING guideline.
© 2015 - 2019 Tomohiro Taira.
This project is licensed under the MIT license. See LICENSE for details.