settings

package
v0.0.0-...-d0837ad Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrExpired = errors.New("cache entry expired")

Functions

func GetCache

func GetCache[T any](key string) (T, error)

func InvalidateCache

func InvalidateCache[T any](key string) error

func PersistChanges

func PersistChanges()

func SetCache

func SetCache[T any](key string, ttl int64, value T) error

func SetCacheRaw

func SetCacheRaw[T any](key string, value T) error

func SetCacheWithExp

func SetCacheWithExp[T any](key string, exp int64, value T) error

Types

type Entry

type Entry[T any] struct {
	Expiration int64 `json:"expiration"`
	Data       T     `json:"data"`
}

type Settings

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

func ReadSettings

func ReadSettings() (*Settings, error)

func (*Settings) GetAutoupdate

func (s *Settings) GetAutoupdate() string

func (*Settings) GetBaseURL

func (s *Settings) GetBaseURL() string

func (*Settings) GetLastUpdateCheck

func (s *Settings) GetLastUpdateCheck() int64

func (*Settings) GetToken

func (s *Settings) GetToken() string

func (*Settings) GetUsername

func (s *Settings) GetUsername() string

func (*Settings) Organization

func (s *Settings) Organization() string

func (*Settings) RegisterUse

func (s *Settings) RegisterUse(cmd string) bool

func (*Settings) SetAutoupdate

func (s *Settings) SetAutoupdate(autoupdate string)

func (*Settings) SetLastUpdateCheck

func (s *Settings) SetLastUpdateCheck(t int64)

func (*Settings) SetOrganization

func (s *Settings) SetOrganization(org string)

func (*Settings) SetToken

func (s *Settings) SetToken(token string)

func (*Settings) SetUsername

func (s *Settings) SetUsername(username string)

Jump to

Keyboard shortcuts

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