internal

package
v0.0.0-...-be30e72 Latest Latest
Warning

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

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

Documentation

Overview

Package internal is a thin wrapper of Google Photos Library API, providing error handling and retrying.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsRetryableError

func IsRetryableError(err error) bool

IsRetryableError returns true if the error is retryable, such as status code is 5xx or network error occurs. Otherwise returns false. See https://developers.google.com/photos/library/guides/best-practices#retrying-failed-requests

func IsRetryableStatusCode

func IsRetryableStatusCode(code int) bool

IsRetryableStatusCode returns true if the status code is retryable, such as status code is 5xx or network error occurs. Otherwise returns false. See https://developers.google.com/photos/library/guides/best-practices#retrying-failed-requests

Types

type Photos

type Photos interface {
	// contains filtered or unexported methods
}

Photos provides Google Photos Library service.

func New

func New(client *http.Client) (Photos, error)

New returns a new Photos.

type UploadItem

type UploadItem interface {
	// Open returns a stream.
	// Caller should close it finally.
	Open() (io.ReadCloser, int64, error)
	// Name returns the filename.
	Name() string
	// String returns the full name, e.g. path or URL.
	String() string
}

UploadItem represents an uploadable item.

type UploadToken

type UploadToken string

UploadToken represents a pointer to the uploaded item.

Jump to

Keyboard shortcuts

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