config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: MIT Imports: 2 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" default:""`
	Port            int    `env:"SOFT_SERVE_PORT" default:"23231"`
	KeyPath         string `env:"SOFT_SERVE_KEY_PATH" default:".ssh/soft_serve_server_ed25519"`
	RepoPath        string `env:"SOFT_SERVE_REPO_PATH" default:".repos"`
	InitialAdminKey string `env:"SOFT_SERVE_INITIAL_ADMIN_KEY" default:""`
	Callbacks       Callbacks
}

Config is the configuration for the 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

Jump to

Keyboard shortcuts

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