components

package
v0.0.0-...-8c70630 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheToken

func CacheToken(config *oauth2.Config) error

CacheToken generates a new OAuth2 Token and caches it locally. It will return an error if the caching fails.

func Client

func Client(ctx context.Context, scopeURL string) (*http.Client, error)

Client creates a new OAuth2 HTTP client that has the given scope of access.

func ClientConfig

func ClientConfig(scopeURL string) (*oauth2.Config, error)

ClientConfig returns an OAuth2 client config for the given scope.

func Token

func Token(config *oauth2.Config) (*oauth2.Token, error)

Token uses a OAuth2 Config to retrieve a Token for the current user. The token is cached locally. If the caching fails, an error is not returned. If the user's permissions change, the cached token must be deleted in order to create a new one.

func WriteSliceToFile

func WriteSliceToFile(filepath string, values []string) error

WriteSliceToFile writes a slice to the file at the filepath. It writes each element of the slice on a separate line.

func WriteSliceToStdout

func WriteSliceToStdout(values []string)

WriteSliceToStdout prints the elements of the slice. Each element is on a new line.

Types

type Sheets

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

Sheets provides access to a Google Sheets instance which works with a particular spreadsheet.

func NewSheets

func NewSheets(client *http.Client, spreadsheet string) (*Sheets, error)

NewSheets creates a new Sheets instance for working with the given spreadsheet.

func (*Sheets) GetColumn

func (s *Sheets) GetColumn(sheet, column string) ([]string, error)

GetColumn retrieves a column from a given sheet. The column must be specified as a single letter.

Jump to

Keyboard shortcuts

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