conf

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Valid

func Valid(cfg *Conf) error

func ValidLibrary

func ValidLibrary(cfg *Conf, conf *LibraryConf) error

func ValidScope

func ValidScope(cfg *Conf, conf *ScopeConf) error

func ValidUser

func ValidUser(cfg *Conf, conf *UserConf) error

Types

type Conf

type Conf struct {
	HttpEnable     bool   `toml:"http_enable"`
	HttpListen     string `toml:"http_listen"`
	HttpsEnable    bool   `toml:"https_enable"`
	HttpsListen    string `toml:"https_listen"`
	TlsKeyPem      string `toml:"tls_key_pem"`
	TlsCertPem     string `toml:"tls_cert_pem"`
	TlsKeyPemPath  string `toml:"tls_key_perm_path"`
	TlsCertPemPath string `toml:"tls_cert_perm_path"`

	Library []*LibraryConf `toml:"library"`
	Scope   []*ScopeConf   `toml:"scope"`
	User    []*UserConf    `toml:"user"`

	Safe *SafeConf `toml:"safe"`
}

func Parse

func Parse(path string) (*Conf, error)

type LibraryConf

type LibraryConf struct {
	Name       string `toml:"name"`
	MountPoint string `toml:"mount_point"`
	Prefix     string `toml:"prefix"`
}

type SafeConf

type SafeConf struct {
	PasswordRetryPerFiveMinute int  `toml:"password_retry_per_five_minute"`
	BanUserWrongPwd            bool `toml:"ban_user_wrong_pwd"`
	BanIpWrongPwd              bool `toml:"ban_ip_wrong_pwd"`
}

type ScopeConf

type ScopeConf struct {
	Name       string   `toml:"name"`
	Library    string   `toml:"library"`
	Include    []string `toml:"include"`
	Exclude    []string `toml:"exclude"`
	Permission []string `toml:"permission"`
}

type UserConf

type UserConf struct {
	Username   string   `toml:"username"`
	Credential string   `toml:"credential"`
	Scope      []string `toml:"scope"`
}

Jump to

Keyboard shortcuts

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