config

package
v0.0.0-...-27dad89 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TemplateFlag            = "template"
	OrgFlag                 = "org"
	TimeoutFlag             = "timeout"
	BranchFlag              = "branch"
	VersionChangeFlag       = "version.change"
	TokenFlag               = "token"
	HostFlag                = "host"
	RepositoriesFlag        = "repositories"
	CreateReleaseBranchFlag = "create_release_branch"
)

Variables

This section is empty.

Functions

func InitViper

func InitViper(filename string, cmd *cobra.Command) error

Types

type Auth

type Auth struct {
	Username string
	Token    string
}

type AuthHosts

type AuthHosts map[string]Auth

AuthHosts format for how auth is stored inside of hosts.yaml.

github.com:

username: NickHackman
token: this-is-a-fake-auth-token

type Config

type Config struct {
	Username            string
	Host                string
	Org                 string
	Branch              string
	Token               string
	Template            string
	CreateReleaseBranch bool
	Repositories        []string
	Timeout             time.Duration
	VersionChange       version.Change

	AuthHosts AuthHosts
	Terminal  *TerminalConfig
}

func Load

func Load() (*Config, error)

func (*Config) CheckAuth

func (c *Config) CheckAuth() error

func (*Config) IsRepositoryToRelease

func (c *Config) IsRepositoryToRelease(name string) bool

func (*Config) Refresh

func (c *Config) Refresh() error

func (*Config) SaveHost

func (c *Config) SaveHost(auth Auth) error

func (*Config) SetSize

func (c *Config) SetSize(width, height int)

func (*Config) Size

func (c *Config) Size() (int, int)

type CreatedConfigErr

type CreatedConfigErr struct {
	Path string
}

CreatedConfigErr error returned when InitViper fails due to the config not existing in the first place and was created at will.

func (CreatedConfigErr) Error

func (cce CreatedConfigErr) Error() string

type TerminalConfig

type TerminalConfig struct {
	Width    int
	Height   int
	Releases chan<- []*github.RepositoryReleaseResponse
}

TerminalConfig configuration maintained for the terminal

Jump to

Keyboard shortcuts

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