config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callbacks

type Callbacks interface {
	Tui(action string)
	Push(repo string)
	Fetch(repo string)
}

Callbacks provides an interface that can be used to run callbacks on different events.

type Config

type Config struct {
	Host            string `env:"SOFT_SERVE_HOST"`
	Port            int    `env:"SOFT_SERVE_PORT"`
	KeyPath         string `env:"SOFT_SERVE_KEY_PATH"`
	RepoPath        string `env:"SOFT_SERVE_REPO_PATH"`
	InitialAdminKey string `env:"SOFT_SERVE_INITIAL_ADMIN_KEY"`
	Callbacks       Callbacks
}

Config is the configuration for Soft Serve.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a Config with the values populated with the defaults or specified environment variables.

func (*Config) WithCallbacks

func (cfg *Config) WithCallbacks(c Callbacks) *Config

WithCallbacks applies the given Callbacks to the configuration.

Jump to

Keyboard shortcuts

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