datadir

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Datadir

func Datadir() string

func Datapath

func Datapath(path string) string

func EnsureDatadir

func EnsureDatadir(dir string) string

func SetDatadir

func SetDatadir(dir string)

Types

type BasicAuth

type BasicAuth struct {
	Username       string   `yaml:"username"`
	Password       string   `yaml:"password"`
	Namespace      string   `yaml:"namespace,omitempty"`
	AllowedSources []string `yaml:"allow,omitempty"`
	// contains filtered or unexported fields
}

func (BasicAuth) Authorize

func (self BasicAuth) Authorize(username string, password string, ipAddr string) bool

type Config

type Config struct {
	Version        string                    `yaml:"version"`
	Logging        LoggingConfig             `yaml:"logging,omitempty"`
	Server         ServerConfig              `yaml:"server"`
	Authorizations []BasicAuth               `yaml:"auth,omitempty"`
	Metrics        MetricsConfig             `yaml:"metrics,omitempty"`
	Neighbors      map[string]NeighborConfig `yaml:"neighbors,omitempty"`
	// contains filtered or unexported fields
}

The root config item

func NewConfig

func NewConfig() *Config

func (Config) Authorize

func (self Config) Authorize(username string, password string, remoteAddress string) string

func (*Config) ParseDatadir

func (self *Config) ParseDatadir() error

func (*Config) SetupLogger

func (self *Config) SetupLogger()

func (Config) ValidateSchema

func (self Config) ValidateSchema() bool

type LoggingConfig

type LoggingConfig struct {
	Output string       `yaml:"output,omitempty"`
	Level  string       `yaml:"level,omitempty"`
	Syslog SyslogConfig `yaml:"syslog,omitempty"`
}

type MetricsConfig

type MetricsConfig struct {
	BearerToken string `yaml:"bearer_token,omitempty"`
}

type NeighborConfig

type NeighborConfig struct {
	Peers []PeerConfig
}

type PeerConfig

type PeerConfig struct {
	ServerUrl string `yaml:"url,omitempty"`
	CertFile  string `yaml:"cert,omitempty"`
}

type ServerConfig

type ServerConfig struct {
	Bind     string          `yaml:"bind,omitempty"`
	HttpBind string          `yaml:"http_bind,omitempty"`
	TLS      ServerTLSConfig `yaml:"tls,omitempty"`
}

type ServerTLSConfig

type ServerTLSConfig struct {
	CertFile string `yaml:"cert,omitempty"`
	KeyFile  string `yaml:"key,omitempty"`
}

type SyslogConfig

type SyslogConfig struct {
	Enabled  bool   `yaml:"enabled,omitempty"`
	URL      string `yaml:"url,omitempty"`
	Protocol string `yaml:"protocol,omitempty"`
}

Jump to

Keyboard shortcuts

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