account

package
v0.0.26 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package account manages service account.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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. https://cloud.google.com/docs/authentication/production

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.

Jump to

Keyboard shortcuts

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