config

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERR_HOST_NOT_FOUND = "host not found in config"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	HostGroups []HostGroup
}

func Load

func Load(path string) (Config, error)

func (Config) GetInfo

func (c Config) GetInfo(host string) (HostInfo, error)

type DefaultOptions

type DefaultOptions struct {
	PathHostCAPrivateKey string `ini:"host-ca-privkey"`
	PathHostCAPublicKey  string `ini:"host-ca-pubkey"`
	PathUserCAPrivateKey string `ini:"user-ca-privkey"`
	PathUserCAPublicKey  string `ini:"user-ca-pubkey"`
	CertValidity         string `ini:"cert-validity"` // allows non-int values, parsed manually
	CacheDuration        int    `ini:"cache-duration"`
}

type HostGroup

type HostGroup struct {
	DefaultOptions
	Keys
	CertDuration int
	Name         string
	Hosts        map[string]string
}

type HostInfo

type HostInfo struct {
	Name          string
	URL           string
	CertDuration  int
	CacheDuration int
	Keys
}

HostInfo is returned from the GetInfo function

type Keys

type Keys struct {
	HostCAPrivateKey interface{}
	HostCAPublicKey  ssh.PublicKey
	UserCAPrivateKey interface{}
	UserCAPublicKey  ssh.PublicKey
}

Jump to

Keyboard shortcuts

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