Skip to content
📷 Go library for accessing the Gyazo API
Go Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gyazo
.editorconfig
.gitignore
.travis.yml
CONTRIBUTING.md
LICENSE
Makefile
README.md
go.mod
go.sum

README.md

go-gyazo

Build Status Coverage Status Go Report Card GoDoc Reference MIT License

go-gyazo is a library for Go for accessing the Gyazo API.

Installation

Use go get:

$ go get -d github.com/tomohiro/go-gyazo

Usage

Create a client to accessing the Gyazo API

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

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
}

Upload

file, _ := os.Open("/your/image/file.png")
defer file.Close()
image, _ := gyazo.Upload(file)
fmt.Println(image.PermalinkURL) // http://gyazo.com/8980c52421e452ac3355ca3e5cfe7a0c

Delete

result, _ := gyazo.Delete("8980c52421e452ac3355ca3e5cfe7a0c")

For complete usage of go-gyazo, see the full package docs.

Contributing

Please check out the CONTIRBUTING guideline.

LICENSE

© 2015 - 2019 Tomohiro Taira.

This project is licensed under the MIT license. See LICENSE for details.

You can’t perform that action at this time.