Documentation
¶
Overview ¶
Most of the code is lifted from https://github.com/googleapis/google-api-go-client/blob/main/internal/settings.go
For details and copyright etc. see above url.
Most of the code is lifted from https://github.com/googleapis/google-api-go-client/blob/main/internal/settings.go
For details and copyright etc. see above url.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
type Credentials struct { ProjectID string `json:"project_id,omitempty"` // may be empty UserID string `json:"user_id,omitempty"` // may be empty, aka client_id Token string `json:"token,omitempty"` // may be empty Expires int64 `json:"expires,omitempty"` // 0 = never, > 0 = unix timestamp, < 0 = invalid }
func (*Credentials) Clone ¶
func (c *Credentials) Clone() *Credentials
func (*Credentials) Expired ¶
func (c *Credentials) Expired() bool
Expired only verifies just that, does not check all other attributes
func (*Credentials) IsValid ¶
func (c *Credentials) IsValid() bool
IsValid test if Crendentials is valid
func (*Credentials) Key ¶
func (c *Credentials) Key() string
type DialSettings ¶
type DialSettings struct { Endpoint string `json:"endpoint,omitempty"` Credentials *Credentials `json:"credentials,omitempty"` Scopes []string `json:"scopes,omitempty"` DefaultScopes []string `json:"default_scopes,omitempty"` UserAgent string `json:"user_agent,omitempty"` APIKey string `json:"api_key,omitempty"` // aka ClientID Status State `json:"status,omitempty"` Options map[string]string `json:"options,omitempty"` // holds all other values ... }
DialSettings holds information needed to establish a connection with a backend API service or to simply configure a service/CLI.
func (*DialSettings) Clone ¶
func (ds *DialSettings) Clone() DialSettings
func (*DialSettings) GetOption ¶
func (ds *DialSettings) GetOption(opt string) string
GetOption returns the custom option opt if it exists or an empty string otherwise
func (*DialSettings) GetScopes ¶
func (ds *DialSettings) GetScopes() []string
GetScopes returns the user-provided scopes, if set, or else falls back to the default scopes.
func (*DialSettings) HasOption ¶
func (ds *DialSettings) HasOption(opt string) bool
HasOption returns true if ds has a custom option opt.
func (*DialSettings) SetOption ¶
func (ds *DialSettings) SetOption(opt, o string)
SetOptions registers a custom option o with key opt.