Documentation ¶ Index ¶ Constants Variables type CfgType func ConvertType(data string) (CfgType, error) type Config func NewConfig(data string, key string, cfgType CfgType, version int) *Config Constants ¶ View Source const ( JSON CfgType = "json" YAML = "yaml" INVALID ) Variables ¶ View Source var ( InvalidError = fmt.Errorf("非法的类型") ) Functions ¶ This section is empty. Types ¶ type CfgType ¶ type CfgType string func ConvertType ¶ func ConvertType(data string) (CfgType, error) type Config ¶ type Config struct { Id primitive.ObjectID `bson:"_id"` Data string `bson:"data"` //数据 Key string `bson:"key"` //key Version int `bson:"version"` //版本 Type CfgType `bson:"type"` } func NewConfig ¶ func NewConfig(data string, key string, cfgType CfgType, version int) *Config Source Files ¶ View all Source files config.go type.go Click to show internal directories. Click to hide internal directories.