Documentation ¶
Overview ¶
尽量减少 conf 的配置参数侵入到其他包中 conf 包只限于 cmd 包下使用
Index ¶
Constants ¶
View Source
const ( // 设置默认文件系统权限 Permissions = fs.FileMode(0755) // DefaultConfigJSON configure json string DefaultConfigJSON = `` /* 323-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Compressor ¶
type ServerConfig ¶
type ServerConfig struct { Port int `json:"port"` Path string `json:"path"` Mode string `json:"mode"` Debug bool `json:"debug"` FileSize int64 `json:"filesize"` LogPath string `json:"log"` Password string `json:"auth"` Encoder Encoder `json:"encoder"` Compressor Compressor `json:"compressor"` }
var ( // Settings global configure options Settings *ServerConfig = new(ServerConfig) // DefaultConfig is the default configuration DefaultConfig *ServerConfig = new(ServerConfig) )
func (*ServerConfig) Marshal ¶
func (opt *ServerConfig) Marshal() ([]byte, error)
func (*ServerConfig) SavedAs ¶
func (opt *ServerConfig) SavedAs(path string) error
SavedAs Settings.Path 存储到磁盘文件中
func (*ServerConfig) String ¶
func (opt *ServerConfig) String() string
func (*ServerConfig) Unmarshal ¶
func (opt *ServerConfig) Unmarshal(data []byte) error
Click to show internal directories.
Click to hide internal directories.