config

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigDir = ".config/chatify"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfKey

type ConfKey string
const (
	SpotifyIDKey     ConfKey = "spotify_id"
	SpotifySecretKey ConfKey = "spotify_secret"
	OpenAIAPIKey     ConfKey = "openai_api_key"
	DeviceID         ConfKey = "device_id"
	PortKey          ConfKey = "port"
	UserIDKey        ConfKey = "user_id"
	AccessTokenKey   ConfKey = "access_token"
	RefreshTokenKey  ConfKey = "refresh_token"
	ExpirationKey    ConfKey = "expiration"
)

type Config

type Config struct {
	// contains filtered or unexported fields
}

func New

func New() (*Config, error)

func (*Config) GetClientValue

func (c *Config) GetClientValue(key ConfKey) string

func (*Config) GetToken

func (c *Config) GetToken() *oauth2.Token

func (*Config) IsClientValid

func (c *Config) IsClientValid() bool

func (*Config) Load

func (c *Config) Load() error

func (*Config) Set

func (c *Config) Set(key ConfKey, value any) error

func (*Config) SetToken

func (c *Config) SetToken(token *oauth2.Token) error

Jump to

Keyboard shortcuts

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