config

package
v0.0.0-...-0c64b01 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Auth command = iota
	Run
)

Variables

This section is empty.

Functions

func ReadCredentials

func ReadCredentials(c Config) map[string]Credential

func WriteConfig

func WriteConfig(c Config)

func WriteCredentials

func WriteCredentials(c Config, credentials map[string]Credential)

Types

type Config

type Config struct {
	AppID          string `yaml:"app_id"`
	AppSecret      string `yaml:"app_secret"`
	ServeAddress   string `yaml:"serve_address"`
	RedirectURI    string `yaml:"redirect_uri"`
	CredentialPath string `yaml:"credential_path"`
	Users          map[string]User
	// contains filtered or unexported fields
}

func CommandLine

func CommandLine() (Config, command)

func ReadConfig

func ReadConfig(path string) Config

type Credential

type Credential struct {
	AccessToken  string `yaml:"access_token" json:"access_token"`
	Expiration   int64  `yaml:"expiration" json:"expires_in"`
	RefreshToken string `yaml:"refresh_token" json:"refresh_token"`
}

type User

type User struct {
	CommentDuration   string   `yaml:"comment_duration"`
	PostDuration      string   `yaml:"post_duration"`
	ExcludeSubreddits []string `yaml:"exclude_subreddits"`
}

Jump to

Keyboard shortcuts

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