config

package
v0.0.0-...-05fba6c Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDashboardURL = "https://foo/bar"
	DefaultServiceURL   = "https://foo/bar"
)

Variables

View Source
var (
	DefaultConfigFile = tools.MyPathTo("pryrite.yaml")
)

Functions

func CreateDefaultConfigIfEmpty

func CreateDefaultConfigIfEmpty() error

func SetEntry

func SetEntry(e *Entry) error

Types

type Config

type Config struct {
	Entries      []Entry `yaml:"entries"`
	DefaultEntry string  `yaml:"default"`
}

func Default

func Default() (*Config, error)

func New

func New(filename string) (*Config, error)

func (*Config) Add

func (c *Config) Add(name, serviceUrl string) error

func (*Config) Del

func (c *Config) Del(name string) error

func (*Config) Get

func (c *Config) Get(name string) (*Entry, bool)

func (*Config) GetDefaultEntry

func (c *Config) GetDefaultEntry() (*Entry, bool)

func (*Config) SaveFile

func (c *Config) SaveFile(filename string) error

func (*Config) Set

func (c *Config) Set(e *Entry) error

func (*Config) SetDefault

func (c *Config) SetDefault(name string) error

type Entry

type Entry struct {
	Name             string                   `yaml:"name"`
	Mode             string                   `yaml:"mode"`
	DashboardUrl     string                   `yaml:"dashboard_url"`
	ServiceUrl       string                   `yaml:"service_url"`
	LastUpdateCheck  time.Time                `yaml:"last_update_check"`
	AuthScheme       string                   `yaml:"auth_scheme"`
	Email            string                   `yaml:"email"`
	ClientID         string                   `yaml:"client_id"`
	SkipSSLCheck     bool                     `yaml:"skip_ssl_check"`
	Style            string                   `yaml:"style"`
	ExecutionTimeout tools.MarshalledDuration `yaml:"execution_timeout"`
	HideInspectIntro bool                     `yaml:"hide_inspect_intro"`
}

func GetEntry

func GetEntry(name string) (*Entry, error)

Jump to

Keyboard shortcuts

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