Documentation
¶
Index ¶
- Variables
- type Config
- func (p *Config) GetAddr() (v string)
- func (p *Config) GetServiceName() (v string)
- func (p *Config) GetSubConfigList() (v []*SubConfig)
- func (p *Config) InitDefault()
- func (p *Config) IsSetAddr() bool
- func (p *Config) Read(iprot thrift.TProtocol) (err error)
- func (p *Config) ReadField1(iprot thrift.TProtocol) error
- func (p *Config) ReadField2(iprot thrift.TProtocol) error
- func (p *Config) ReadField3(iprot thrift.TProtocol) error
- func (p *Config) String() string
- func (p *Config) Write(oprot thrift.TProtocol) (err error)
- type ConfigGenerateMeta
- type ConfigKvPair
- func (p *ConfigKvPair) GetDesc() (v string)
- func (p *ConfigKvPair) GetKey() (v string)
- func (p *ConfigKvPair) GetKind() (v string)
- func (p *ConfigKvPair) GetValue() (v string)
- func (p *ConfigKvPair) GetValueType() (v ConfigValueType)
- func (p *ConfigKvPair) InitDefault()
- func (p *ConfigKvPair) Read(iprot thrift.TProtocol) (err error)
- func (p *ConfigKvPair) ReadField1(iprot thrift.TProtocol) error
- func (p *ConfigKvPair) ReadField2(iprot thrift.TProtocol) error
- func (p *ConfigKvPair) ReadField3(iprot thrift.TProtocol) error
- func (p *ConfigKvPair) ReadField4(iprot thrift.TProtocol) error
- func (p *ConfigKvPair) ReadField5(iprot thrift.TProtocol) error
- func (p *ConfigKvPair) String() string
- func (p *ConfigKvPair) Write(oprot thrift.TProtocol) (err error)
- type ConfigValueType
- type Field
- type FieldTag
- type Result
- type Struct
- type SubConfig
- func (p *SubConfig) GetConfigKvPairList() (v []*ConfigKvPair)
- func (p *SubConfig) GetNameSpace() (v string)
- func (p *SubConfig) InitDefault()
- func (p *SubConfig) Read(iprot thrift.TProtocol) (err error)
- func (p *SubConfig) ReadField1(iprot thrift.TProtocol) error
- func (p *SubConfig) ReadField2(iprot thrift.TProtocol) error
- func (p *SubConfig) String() string
- func (p *SubConfig) Write(oprot thrift.TProtocol) (err error)
- type SubConfigMetadata
- type Yaml2Go
Constants ¶
This section is empty.
Variables ¶
View Source
var Config_Addr_DEFAULT string
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { ServiceName string `thrift:"ServiceName,1" json:"ServiceName"` SubConfigList []*SubConfig `thrift:"SubConfigList,2" json:"SubConfigList"` Addr *string `thrift:"addr,3,optional" json:"addr,omitempty"` }
func (*Config) GetServiceName ¶
func (*Config) GetSubConfigList ¶
func (*Config) InitDefault ¶
func (p *Config) InitDefault()
type ConfigGenerateMeta ¶
type ConfigGenerateMeta struct { Desc string `json:"desc,omitempty"` Kind string `json:"kind,omitempty"` ConfigStruct Struct `json:"config_struct,omitempty"` ConfigValueType ConfigValueType `json:"config_value_type,omitempty"` Key string `json:"key,omitempty"` // contains filtered or unexported fields }
type ConfigKvPair ¶
type ConfigKvPair struct { Key string `thrift:"Key,1" json:"Key"` Value string `thrift:"Value,2" json:"Value"` ValueType ConfigValueType `thrift:"ValueType,3" json:"ValueType"` Desc string `thrift:"Desc,4" json:"Desc"` Kind string `thrift:"kind,5" json:"kind"` }
func NewConfigKvPair ¶
func NewConfigKvPair() *ConfigKvPair
func (*ConfigKvPair) GetDesc ¶
func (p *ConfigKvPair) GetDesc() (v string)
func (*ConfigKvPair) GetKey ¶
func (p *ConfigKvPair) GetKey() (v string)
func (*ConfigKvPair) GetKind ¶
func (p *ConfigKvPair) GetKind() (v string)
func (*ConfigKvPair) GetValue ¶
func (p *ConfigKvPair) GetValue() (v string)
func (*ConfigKvPair) GetValueType ¶
func (p *ConfigKvPair) GetValueType() (v ConfigValueType)
func (*ConfigKvPair) InitDefault ¶
func (p *ConfigKvPair) InitDefault()
func (*ConfigKvPair) ReadField1 ¶
func (p *ConfigKvPair) ReadField1(iprot thrift.TProtocol) error
func (*ConfigKvPair) ReadField2 ¶
func (p *ConfigKvPair) ReadField2(iprot thrift.TProtocol) error
func (*ConfigKvPair) ReadField3 ¶
func (p *ConfigKvPair) ReadField3(iprot thrift.TProtocol) error
func (*ConfigKvPair) ReadField4 ¶
func (p *ConfigKvPair) ReadField4(iprot thrift.TProtocol) error
func (*ConfigKvPair) ReadField5 ¶
func (p *ConfigKvPair) ReadField5(iprot thrift.TProtocol) error
func (*ConfigKvPair) String ¶
func (p *ConfigKvPair) String() string
type ConfigValueType ¶
type ConfigValueType int64
const ( ConfigValueType_JsonType ConfigValueType = 1 ConfigValueType_YamlType ConfigValueType = 2 ConfigValueType_XmlType ConfigValueType = 3 ConfigValueType_TextType ConfigValueType = 4 )
func ConfigValueTypeFromString ¶
func ConfigValueTypeFromString(s string) (ConfigValueType, error)
func ConfigValueTypePtr ¶
func ConfigValueTypePtr(v ConfigValueType) *ConfigValueType
func (*ConfigValueType) Scan ¶
func (p *ConfigValueType) Scan(value interface{}) (err error)
func (ConfigValueType) String ¶
func (p ConfigValueType) String() string
type Field ¶
type Field struct { FieldName string `json:"field_name,omitempty"` // FieldName of the field Value string `json:"value,omitempty"` // Value of the field (used for primitive types) FieldType string `json:"field_type,omitempty"` // FieldType of the field IsStruct bool `json:"is_struct"` IsSlice bool `json:"is_slice"` IsBasicType bool `json:"is_basic"` Tags []FieldTag `json:"tags,omitempty"` Children []Field `json:"children,omitempty"` }
type Result ¶
type Result struct { ServiceName string `json:"service_name,omitempty"` Addr string `json:"addr,omitempty"` SubConfigMetadataList []SubConfigMetadata `json:"sub_config_metadata_list,omitempty"` }
func HandleRequest ¶
HandleRequest processes the configuration request and returns the result.
type Struct ¶
type Struct struct { StructName string `json:"struct_name,omitempty"` Fields []Field `json:"fields,omitempty"` }
Struct to store struct fields
type SubConfig ¶
type SubConfig struct { NameSpace string `thrift:"NameSpace,1" json:"NameSpace"` ConfigKvPairList []*ConfigKvPair `thrift:"ConfigKvPairList,2" json:"ConfigKvPairList"` }
func NewSubConfig ¶
func NewSubConfig() *SubConfig
func (*SubConfig) GetConfigKvPairList ¶
func (p *SubConfig) GetConfigKvPairList() (v []*ConfigKvPair)
func (*SubConfig) GetNameSpace ¶
func (*SubConfig) InitDefault ¶
func (p *SubConfig) InitDefault()
type SubConfigMetadata ¶
type SubConfigMetadata struct { Namespace string `json:"namespace,omitempty"` ConfigMetadata []ConfigGenerateMeta `json:"config_metadata,omitempty"` }
type Yaml2Go ¶
type Yaml2Go struct { StructsMeta *ConfigGenerateMeta // contains filtered or unexported fields }
Yaml2Go to store converted result
func New ¶
func New(key, desc, kind string, configValueType ConfigValueType) Yaml2Go
New creates Yaml2Go object
func (*Yaml2Go) AppendResult ¶
AppendResult add lines to the result
Click to show internal directories.
Click to hide internal directories.