googlephotoclient

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

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

Go to latest
Published: Sep 8, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound     = errors.New("media item not found")
	ErrServerFailed = errors.New("internal server error")
)

Functions

func NewFileItem

func NewFileItem(name string, size int64, data io.ReadSeeker) iface.FileItem

Types

type Client

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

func New

func New(client *http.Client, offsetStore iface.Storer, logger iface.Logger) (*Client, error)

func (*Client) ListMediaItems

func (r *Client) ListMediaItems(size int64, nextToken string) (string, []*MediaItem, error)

func (Client) UploadFile

func (r Client) UploadFile(ctx context.Context, fileInfo iface.FileItem) (string, error)

func (Client) UploadFilePart

func (r Client) UploadFilePart(ctx context.Context, fileInfo iface.FileItem) (string, error)

func (Client) UploadFileToLibrary

func (r Client) UploadFileToLibrary(ctx context.Context, token string) (MediaItem, error)

UploadFileToLibrary uploads the specified file to Google Photos.

type MediaItem

type MediaItem struct {
	ID            string
	Description   string
	ProductURL    string
	BaseURL       string
	MimeType      string
	MediaMetadata MediaMetadata
	Filename      string
}

MediaItem represents of a media item (such as a photo or video) in Google Photos. See: https://developers.google.com/photos/library/reference/rest/v1/mediaItems

type MediaMetadata

type MediaMetadata struct {
	CreationTime string
	Width        string
	Height       string
}

MediaMetadata represents metadata for a media item. See: https://developers.google.com/photos/library/reference/rest/v1/mediaItems

Jump to

Keyboard shortcuts

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