config

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: CC0-1.0 Imports: 18 Imported by: 0

README

Refer to the go-sockaddr documentation for details about the supported functions.

sock_addr_template.gosock_addr_template_test.go

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SupportedKeyTypes = []string{model.KeyTypeRSA}
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Hostname       string                `hcl:"hostname"`
	Raft           Raft                  `hcl:"raft,block"`
	Servers        []model.OAuthServer   `hcl:"server,block"`
	Clients        []model.OAuthClient   `hcl:"client,block"`
	ConnectionSets []model.ConnectionSet `hcl:"connection_set,block"`
}

Config holds all the configuration data for the server.

func NewFromFile

func NewFromFile(fileName string) (*Config, error)

NewFromFile reads a configuration file and attempts to decode it into a config struct.

func (*Config) ConnectionSetIDs

func (c *Config) ConnectionSetIDs() []string

func (*Config) IsEqual

func (c *Config) IsEqual(other *Config) bool

IsEqual returns true if the two configurations are equal.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration.

type Raft

type Raft struct {
	PeerID  string   `hcl:"peer_id"`
	DataDir string   `hcl:"data_dir"`
	Peers   []string `hcl:"peers"`
}

Raft is used to configure the Raft consensus.

Jump to

Keyboard shortcuts

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