config

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	IPAddress         string             `yaml:"ip" validate:"ip4_addr,required" default:"0.0.0.0"`
	Port              uint16             `yaml:"port" validate:"gt=0,lte=65535" default:"80"`
	RequestsPerMinute int64              `yaml:"rate" default:"60"`
	Features          Features           `yaml:"features"`
	TLS               *tls.Configuration `yaml:"tls,omitempty"`
}

func (*Config) Check

func (c *Config) Check() error

type Features

type Features struct {
	// Allow saving new configuration revision
	AllowSave bool `yaml:"allow_save" json:"allow_save"`
	// Allow saving new configuration revision for new devices
	AllowNew bool `yaml:"allow_new" json:"allow_new"`
	// Allow restoring user saved revisions
	AllowRestoreUser bool `yaml:"allow_restore_user" json:"allow_restore_user"`
	// Maximum revision count to keep
	MaxBackups int `yaml:"max_backups" validate:"gt=0" default:"100" json:"max_backups"`
	// This server handles only portal requests
	IsPortal bool `yaml:"is_portal" json:"is_portal,omitempty"`
}

Jump to

Keyboard shortcuts

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