config

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultClientID = "51e726d0-22a4-45f7-a71c-b472ff84c027"
	DefaultTenantID = "common"
)

Variables

This section is empty.

Functions

func AccountsDir

func AccountsDir() string

func ConfigDir

func ConfigDir() 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 Load

func Load() (*Config, error)

Load reads config from disk

func (*Config) GetClient

func (c *Config) GetClient(email string) Client

GetClient returns the client config for an account, or defaults

func (*Config) GetDefaultAccount

func (c *Config) GetDefaultAccount() string

GetDefaultAccount returns the default account

func (*Config) GetTimezone added in v0.6.0

func (c *Config) GetTimezone() string

GetTimezone returns the configured display timezone

func (*Config) RemoveAccount

func (c *Config) RemoveAccount(email string)

RemoveAccount removes an account from config

func (*Config) Save

func (c *Config) Save() error

Save writes config to disk

func (*Config) SetClient

func (c *Config) SetClient(email string, client Client)

SetClient stores a client configuration for an account

func (*Config) SetDefaultAccount

func (c *Config) SetDefaultAccount(email string)

SetDefaultAccount sets the default account

func (*Config) SetTimezone added in v0.6.0

func (c *Config) SetTimezone(tz string)

SetTimezone sets the display timezone

Jump to

Keyboard shortcuts

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