gmajcfg

package
v0.0.0-...-28279fb Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadKeyLen = errors.New("gmaj: key length must be divisible by 8")
	ErrBadIDLen  = errors.New("gmaj: ID length must be  key length/8")
)

configuration errors

View Source
var DefaultConfig = &Config{
	KeySize:               dfltKeySize,
	IDLength:              dfltKeySize / 8,
	FixNextFingerInterval: 50 * time.Millisecond,
	StabilizeInterval:     100 * time.Millisecond,
	RetryInterval:         200 * time.Millisecond,
	DialOptions: []grpc.DialOption{
		grpc.WithInsecure(),
	},
	Log: log.New(os.Stderr, "gmaj: ", log.LstdFlags),
}

DefaultConfig is the default configuration.

Functions

This section is empty.

Types

type Config

type Config struct {
	// KeySize is the number of bits (i.e. M value), divisible by 8
	KeySize               int
	IDLength              int // must be KeyLength/8
	FixNextFingerInterval time.Duration
	StabilizeInterval     time.Duration
	ConnectionTimeout     time.Duration
	RetryInterval         time.Duration
	DialOptions           []grpc.DialOption

	Log grpclog.Logger
}

Config contains all the configuration information for a gmaj node.

func (*Config) Validate

func (config *Config) Validate() error

Validate checks some of the values of a Config to make sure they are valid.

Jump to

Keyboard shortcuts

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