📷 Go library for accessing the Gyazo API
Switch branches/tags
Nothing to show
Clone or download
Latest commit 8754bff Jul 2, 2017
Permalink
Failed to load latest commit information.
gyazo Use errors package to wrap error for more readable errors May 21, 2016
.gitignore Use `dep` instead of `glide` to dependency management Jun 30, 2017
.travis.yml Add Go 1.7 to build Jul 2, 2017
CONTRIBUTING.md Add contributing guideline Oct 17, 2015
Gopkg.toml Use `dep` instead of `glide` to dependency management Jun 30, 2017
LICENSE Update copyright year Jun 30, 2017
Makefile Use `dep` instead of `glide` to dependency management Jun 30, 2017
README.md

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 - 2017 Tomohiro TAIRA.

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