config

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Log struct {
		Level string `yaml:"level"`
	} `yaml:"log"`

	Auth struct {
		ClientID     string `yaml:"client_id"`
		ClientSecret string `yaml:"client_secret"`
	} `yaml:"auth"`

	Cache TokenCache `yaml:"cache"`
}

func Load

func Load(logger *logrus.Logger, path string) (*Config, error)

func (*Config) CacheAuth

func (c *Config) CacheAuth(l *logrus.Logger, path string, token *oauth2.Token) error

func (*Config) Save

func (c *Config) Save(logger *logrus.Logger, path string) error

func (*Config) Validate

func (c *Config) Validate() error

type TokenCache

type TokenCache struct {
	RefreshToken string    `yaml:"refresh_token"`
	AccessToken  string    `yaml:"access_token"`
	ExpiryDate   time.Time `yaml:"expiry"`
	Type         string    `yaml:"type"`
}

Jump to

Keyboard shortcuts

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