Documentation
¶
Index ¶
- Constants
- func HasCustom(path string) bool
- func Load(file string, opt *ServerOptions) error
- func Vaildated(opt *ServerOptions) error
- type AuthValidator
- type Checkpoint
- type Compressor
- type Encryptor
- type EncryptorValidator
- type PathValidator
- type PortValidator
- type Region
- type ServerOptions
- func (opt *ServerOptions) CheckpointInterval() uint32
- func (opt *ServerOptions) CompactRegionInterval() string
- func (opt *ServerOptions) IsCheckpointEnabled() bool
- func (opt *ServerOptions) IsCompactRegionEnabled() bool
- func (opt *ServerOptions) IsCompressionEnabled() bool
- func (opt *ServerOptions) IsEncryptionEnabled() bool
- func (opt *ServerOptions) IsWhitelistIPEnabled() bool
- func (opt *ServerOptions) Marshal() ([]byte, error)
- func (opt *ServerOptions) Saved() error
- func (opt *ServerOptions) SavedAs(path string) error
- func (opt *ServerOptions) Secret() []byte
- func (opt *ServerOptions) String() string
- func (opt *ServerOptions) Unmarshal(data []byte) error
- type Validator
Constants ¶
View Source
const ( // Default file system permission FSPerm = fs.FileMode(0755) // DefaultConfigJSON configure json string DefaultConfigJSON = `` /* 435-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
func Vaildated ¶
func Vaildated(opt *ServerOptions) error
Types ¶
type AuthValidator ¶
type AuthValidator struct{}
func (AuthValidator) Validate ¶
func (AuthValidator) Validate(opt *ServerOptions) error
type Checkpoint ¶ added in v1.1.1
type Compressor ¶
type Compressor struct {
Enable bool `json:"enable"`
}
type EncryptorValidator ¶
type EncryptorValidator struct{}
func (EncryptorValidator) Validate ¶
func (EncryptorValidator) Validate(opt *ServerOptions) error
type PathValidator ¶
type PathValidator struct{}
func (PathValidator) Validate ¶
func (PathValidator) Validate(opt *ServerOptions) error
type PortValidator ¶
type PortValidator struct{}
func (PortValidator) Validate ¶
func (PortValidator) Validate(opt *ServerOptions) error
type ServerOptions ¶
type ServerOptions struct {
Port int `json:"port"`
Path string `json:"path"`
Debug bool `json:"debug"`
LogPath string `json:"logpath"`
Password string `json:"auth"`
Region Region `json:"region"`
Encryptor Encryptor `json:"encryptor"`
Compressor Compressor `json:"compressor"`
Checkpoint Checkpoint `json:"checkpoint"`
AllowIP []string `json:"allowip"`
}
var ( // Settings global configure options Settings *ServerOptions = new(ServerOptions) // Default is the default configuration Default *ServerOptions = new(ServerOptions) )
func (*ServerOptions) CheckpointInterval ¶ added in v1.1.1
func (opt *ServerOptions) CheckpointInterval() uint32
func (*ServerOptions) CompactRegionInterval ¶ added in v1.1.1
func (opt *ServerOptions) CompactRegionInterval() string
func (*ServerOptions) IsCheckpointEnabled ¶ added in v1.1.1
func (opt *ServerOptions) IsCheckpointEnabled() bool
func (*ServerOptions) IsCompactRegionEnabled ¶ added in v1.1.1
func (opt *ServerOptions) IsCompactRegionEnabled() bool
func (*ServerOptions) IsCompressionEnabled ¶
func (opt *ServerOptions) IsCompressionEnabled() bool
func (*ServerOptions) IsEncryptionEnabled ¶
func (opt *ServerOptions) IsEncryptionEnabled() bool
func (*ServerOptions) IsWhitelistIPEnabled ¶ added in v1.1.1
func (opt *ServerOptions) IsWhitelistIPEnabled() bool
func (*ServerOptions) Marshal ¶
func (opt *ServerOptions) Marshal() ([]byte, error)
func (*ServerOptions) Saved ¶
func (opt *ServerOptions) Saved() error
func (*ServerOptions) SavedAs ¶
func (opt *ServerOptions) SavedAs(path string) error
func (*ServerOptions) Secret ¶
func (opt *ServerOptions) Secret() []byte
func (*ServerOptions) String ¶
func (opt *ServerOptions) String() string
func (*ServerOptions) Unmarshal ¶
func (opt *ServerOptions) Unmarshal(data []byte) error
type Validator ¶
type Validator interface {
Validate(*ServerOptions) error
}
Click to show internal directories.
Click to hide internal directories.