Categorygithub.com/snapas/go-snapas
modulepackage
0.1.0
Repository: https://github.com/snapas/go-snapas.git
Documentation: pkg.go.dev

# README

go-snapas

godoc

Official Snap.as Go client library.

Installation

go get github.com/snapas/go-snapas

Documentation

See all functionality and usages in the API documentation.

Example usage

import (
	"github.com/snapas/go-snapas"
	"github.com/writeas/go-writeas/v2"
	"log"
)

func main() {
	// Authenticate with Write.as
	wc := writeas.NewClient()
	u, err := wc.LogIn("demo", "demo")
	if err != nil {
		log.Fatal(err)
	}

	// Upload to Snap.as
	sc := snapas.NewClient(u.AccessToken)
	p, err := sc.UploadPhoto(&snapas.PhotoParams{
		FileName: "image.jpg",
	})
	if err != nil {
		wc.LogOut()
		log.Fatal(err)
	}

	// Output final domain
	log.Println(p.URL)

	// Clean up
	wc.LogOut()
}

License

MIT

# Functions

NewClient creates a new API client.
NewClientWith builds a new API client with the provided configuration.
NewDevClient creates a new API client for development and testing.

# Structs

Album represents a Snap.as photo album / gallery.
Client is used to interact with the Snap.as API.
No description provided by the author
No description provided by the author