Back to

Package account

Latest Go to latest

The latest major version is .

Published: Jul 31, 2020 | License: BSD-3-Clause | Module:


Package account manages service account.


type Account

type Account interface {
	// Equals compare account with other.
	Equals(other Account) bool

	// Token generates new oauth2 token for the account.
	Token(ctx context.Context) (*oauth2.Token, error)

Account represents service account.

type Empty

type Empty struct{}

Empty doesn't provide any service accounts.

func (Empty) New

func (e Empty) New(name string) (Account, error)

type JSONDir

type JSONDir struct {
	Dir    string
	Scopes []string

JSONDir is a Pool with json files. It should be used for experiments only. we need to rotate keys. It uses application default credential, if "default" is requested.

func (JSONDir) New

func (j JSONDir) New(name string) (Account, error)

New creates new account by loading json file in the dir. if name is "default", returns default service account instead.

type Pool

type Pool interface {
	// New creates new account for name.
	New(name string) (Account, error)

Pool manages service accounts.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier