Documentation
¶
Index ¶
- Constants
- func AccountsDir() string
- func ConfigDir() string
- func ConfigFilePath() string
- func EnsureConfigDir() error
- type Client
- type Config
- func (c *Config) GetClient(email string) Client
- func (c *Config) GetDefaultAccount() string
- func (c *Config) GetTimezone() string
- func (c *Config) RemoveAccount(email string)
- func (c *Config) Save() error
- func (c *Config) SetClient(email string, client Client)
- func (c *Config) SetDefaultAccount(email string)
- func (c *Config) SetTimezone(tz string)
Constants ¶
View Source
const ( DefaultClientID = "51e726d0-22a4-45f7-a71c-b472ff84c027" DefaultTenantID = "common" )
Variables ¶
This section is empty.
Functions ¶
func AccountsDir ¶
func AccountsDir() string
func ConfigFilePath ¶
func ConfigFilePath() string
func EnsureConfigDir ¶
func EnsureConfigDir() error
Types ¶
type Client ¶
type Client struct {
ClientID string `json:"client_id"`
TenantID string `json:"tenant_id,omitempty"`
}
Client represents an OAuth2 client configuration
type Config ¶
type Config struct {
DefaultAccount string `json:"default_account,omitempty"`
Clients map[string]Client `json:"clients,omitempty"`
Timezone string `json:"timezone,omitempty"`
// contains filtered or unexported fields
}
Config represents the olk configuration
func (*Config) GetDefaultAccount ¶
GetDefaultAccount returns the default account
func (*Config) GetTimezone ¶ added in v0.6.0
GetTimezone returns the configured display timezone
func (*Config) RemoveAccount ¶
RemoveAccount removes an account from config
func (*Config) SetDefaultAccount ¶
SetDefaultAccount sets the default account
func (*Config) SetTimezone ¶ added in v0.6.0
SetTimezone sets the display timezone
Click to show internal directories.
Click to hide internal directories.