gphotos

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToString

func ToString(a interface{}) string

ToString converts an interface into a string representation of the data

Types

type Client

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

Client is a client for interacting with google photos api.

func NewGPhotos

func NewGPhotos(client *http.Client) *Client

NewGPhotos creates a new client.

func (*Client) DownloadMedia

func (c *Client) DownloadMedia(ctx context.Context, gphoto GPhoto) error

DownloadMedia - todo

func (*Client) GetPagedLibraryContents

func (c *Client) GetPagedLibraryContents(ctx context.Context, search *Search, nextPage string) (*GPhotos, error)

GetPagedLibraryContents - todo

func (*Client) UploadMedia

func (c *Client) UploadMedia(ctx context.Context, gphoto GPhoto) (string, error)

UploadMedia - todo

type GPhoto

type GPhoto struct {
	ID            string         `json:"id"`
	ProductURL    string         `json:"productUrl"`
	BaseURL       string         `json:"BaseUrl"`
	MimeType      string         `json:"MimeType"`
	MediaMetaData gMediaMetaData `json:"mediaMetadata,omitempty"`
	Filename      string         `json:"filename"`
}

GPhoto google photo details

type GPhotos

type GPhotos struct {
	MediaItems    []GPhoto `json:"mediaItems"`
	NextPageToken string   `json:"nextPageToken"`
}

GPhotos list of photos and other meta data

type GphotoDate

type GphotoDate struct {
	Day   int `json:"day"`
	Month int `json:"month"`
	Year  int `json:"year"`
}

GphotoDate date format for searching

type GphotoDateFilter

type GphotoDateFilter struct {
	Dates  []GphotoDate `json:"dates,omitempty"`
	Ranges []string     `json:"ranges,omitempty"`
}

GphotoDateFilter date filter

type GphotoFilters

type GphotoFilters struct {
	DateFilter               GphotoDateFilter `json:"dateFilter,omitempty"`
	ContentFilter            interface{}      `json:"contentFilter,omitempty"`
	MediaTypeFilter          interface{}      `json:"mediaTypeFilter,omitempty"`
	FeatureFilter            interface{}      `json:"featureFilter,omitempty"`
	IncludeArchivedMedia     bool             `json:"includeArchivedMedia,omitempty"`
	ExcludeNonAppCreatedData bool             `json:"excludeNonAppCreatedData,omitempty"`
}

GphotoFilters filters test

type Search struct {
	AlbumID   string        `json:"albumId,omitempty"`
	PageSize  string        `json:"pageSize,omitempty"`
	PageToken string        `json:"pageToken,omitempty"`
	Filters   GphotoFilters `json:"filters,omitempty"`
}

Search search body

Jump to

Keyboard shortcuts

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