googlephotos

package
v0.0.0-...-5ab89ad Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package google_photos contains all the types used with communication with Google Photos API

Package googlephotos contains all the types used with communication with Google Photos API

Index

Constants

View Source
const (
	// MaxAddPhotosPerCall is the maximum number of photos to add to
	// an album in one single call.
	MaxAddPhotosPerCall = 50
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Album

type Album struct {
	ID    string
	Title string
}

Album type

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is Our API client type. Create with NewClient().

func MustCreateClient

func MustCreateClient(clientID, clientSecret string, token *oauth2.Token) *Client

Returns a cached Photos client

func MustGetClient

func MustGetClient() *Client

Returns a cached, previously created Photos client

func (*Client) AddToAlbum

func (c *Client) AddToAlbum(album *Album, uploadTokens []string) error

AddToAlbum adds the photos identified by their upload tokens to the album

func (*Client) CreateAlbum

func (c *Client) CreateAlbum(name string) (*Album, error)

CreateAlbum creates a new album

func (*Client) ListAlbums

func (c *Client) ListAlbums() ([]*Album, error)

ListAlbums Lists all the Albums

func (*Client) UploadPhoto

func (c *Client) UploadPhoto(path string,
	callback func(int64)) (string, error)

UploadPhoto uploads a photo to an album synchronously. If callback parameter is specified, it will get called when data has been submitted. Returns either an upload token or an error.

Directories

Path Synopsis
Manages authenticating to Google and providing an OAuth2 token
Manages authenticating to Google and providing an OAuth2 token

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL