Documentation
¶
Index ¶
- func ParseSingleValue(jsonStr string, name string) (string, error)
- func ParseSingleValueWithEncoder(jsonStr string, name string, encoder IRequestEncoder) (string, error)
- type Element
- func (e *Element) Append(child *Element) *Element
- func (e *Element) CData(text string) *Element
- func (e *Element) FirstChild() *Element
- func (e *Element) Get(tagName string) *Element
- func (e *Element) GetAll() []*Element
- func (e *Element) GetAllByTag(tagName string) []*Element
- func (e *Element) GetAttributeString(attributeName string) string
- func (e *Element) GetBool(tagName string) (bool, error)
- func (e *Element) GetDate(tagNames ...string) string
- func (e *Element) GetDateWithFormat(layout string, tagNames ...string) string
- func (e *Element) GetDecimal(tagName string) *decimal.Decimal
- func (e *Element) GetInt(tagName string) *int
- func (e *Element) GetNode() *xmlquery.Node
- func (e *Element) GetRootDoc() *xmlquery.Node
- func (e *Element) GetString(tagNames ...string) string
- func (e *Element) Has(tagName string) bool
- func (e *Element) Remove(tagName string) *Element
- func (e *Element) Set(name, value string) *Element
- func (e *Element) Tag() string
- func (e *Element) Text(text string) *Element
- type ElementTree
- func (et *ElementTree) AddNamespace(prefix, uri string)
- func (et *ElementTree) Element(tagName string) (*Element, error)
- func (et *ElementTree) Get(tagName string) *Element
- func (et *ElementTree) SubElement(parent *Element, tagName string) (*Element, error)
- func (et *ElementTree) SubElementWithCdataValue(parent *Element, tagName, value string) (*Element, error)
- func (et *ElementTree) SubElementWithDecimal(parent *Element, tagName string, value *decimal.Decimal) (*Element, error)
- func (et *ElementTree) SubElementWithFlag(parent *Element, tagName string, value iflag.IFlag) (*Element, error)
- func (et *ElementTree) SubElementWithInt(parent *Element, tagName string, value int) (*Element, error)
- func (et *ElementTree) SubElementWithMappedConstant(parent *Element, tagName string, value imappedconstant.IMappedConstant) (*Element, error)
- func (et *ElementTree) SubElementWithStringConstant(parent *Element, tagName string, value istringconstant.IStringConstant) (*Element, error)
- func (et *ElementTree) SubElementWithValue(parent *Element, tagName, value string) (*Element, error)
- func (et *ElementTree) ToString(root *Element) (string, error)
- type IRequestEncoder
- type JsonDoc
- func NewJsonDoc() *JsonDoc
- func NewJsonDocWithEncoder(encoder IRequestEncoder) *JsonDoc
- func NewJsonDocWithValues(values map[string]interface{}) *JsonDoc
- func NewJsonDocWithValuesAndEncoder(values map[string]interface{}, encoder IRequestEncoder) *JsonDoc
- func Parse(jsonStr string) (*JsonDoc, error)
- func ParseBytes(jsonBytes []byte) (*JsonDoc, error)
- func ParseWithEncoder(jsonStr string, encoder IRequestEncoder) (*JsonDoc, error)
- func (jd *JsonDoc) Get(name string) *JsonDoc
- func (jd *JsonDoc) GetArray(name string) []*JsonDoc
- func (jd *JsonDoc) GetBool(name string) bool
- func (jd *JsonDoc) GetDecimal(name string) *decimal.Decimal
- func (jd *JsonDoc) GetInt(name string) *int
- func (jd *JsonDoc) GetIntOrStringAsString(name string) string
- func (jd *JsonDoc) GetString(name string) string
- func (jd *JsonDoc) GetStringArray(name string) []string
- func (jd *JsonDoc) Has(name string) bool
- func (jd *JsonDoc) Remove(key string) *JsonDoc
- func (jd *JsonDoc) Set(key string, value string, force bool) *JsonDoc
- func (jd *JsonDoc) SetBool(key string, value bool) *JsonDoc
- func (jd *JsonDoc) SetEnum(key string, value devicetype.DeviceType, force bool) *JsonDoc
- func (jd *JsonDoc) SetInt(key string, value *int) *JsonDoc
- func (jd *JsonDoc) SetIntArray(key string, values []int) *JsonDoc
- func (jd *JsonDoc) SetJsonDoc(key string, value *JsonDoc) *JsonDoc
- func (jd *JsonDoc) SetStringArray(key string, values []string) *JsonDoc
- func (jd *JsonDoc) ToString() (string, error)
- type MessageWriter
- func (mw *MessageWriter) Add(b byte)
- func (mw *MessageWriter) AddByteConstant(constant ibyteconstant.IByteConstant)
- func (mw *MessageWriter) AddInt(value int)
- func (mw *MessageWriter) AddIntWithLength(value int, length int)
- func (mw *MessageWriter) AddRange(bytes []byte)
- func (mw *MessageWriter) AddRangePadded(fieldValue string, digitCount int)
- func (mw *MessageWriter) AddRangePaddedInt(fieldValue int, digitCount int)
- func (mw *MessageWriter) AddString(value string)
- func (mw *MessageWriter) AddStringConstant(constant istringconstant.IStringConstant)
- func (mw *MessageWriter) GetMessageRequest() *strings.Builder
- func (mw *MessageWriter) Length() int
- func (mw *MessageWriter) Pop()
- func (mw *MessageWriter) SetMessageRequest(messageRequest strings.Builder)
- func (mw *MessageWriter) String() string
- func (mw *MessageWriter) ToArray() []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseSingleValueWithEncoder ¶
func ParseSingleValueWithEncoder(jsonStr string, name string, encoder IRequestEncoder) (string, error)
Types ¶
type Element ¶ added in v1.1.2
type Element struct {
// contains filtered or unexported fields
}
func NewElement ¶ added in v1.1.2
func (*Element) FirstChild ¶ added in v1.1.2
func (*Element) GetAllByTag ¶ added in v1.1.2
func (*Element) GetAttributeString ¶ added in v1.1.2
func (*Element) GetDateWithFormat ¶ added in v1.1.2
func (*Element) GetDecimal ¶ added in v1.1.2
func (*Element) GetRootDoc ¶ added in v1.1.2
type ElementTree ¶ added in v1.1.2
type ElementTree struct {
// contains filtered or unexported fields
}
func NewElementTree ¶ added in v1.1.2
func NewElementTree(namespaces map[string]string) *ElementTree
func ParseWithNamespaces ¶ added in v1.1.2
func ParseWithNamespaces(buffer []byte, namespaces map[string]string) (*ElementTree, error)
func ParseXml ¶ added in v1.1.2
func ParseXml(buffer []byte) (*ElementTree, error)
func (*ElementTree) AddNamespace ¶ added in v1.1.2
func (et *ElementTree) AddNamespace(prefix, uri string)
func (*ElementTree) Element ¶ added in v1.1.2
func (et *ElementTree) Element(tagName string) (*Element, error)
func (*ElementTree) Get ¶ added in v1.1.2
func (et *ElementTree) Get(tagName string) *Element
func (*ElementTree) SubElement ¶ added in v1.1.2
func (et *ElementTree) SubElement(parent *Element, tagName string) (*Element, error)
func (*ElementTree) SubElementWithCdataValue ¶ added in v1.1.2
func (et *ElementTree) SubElementWithCdataValue(parent *Element, tagName, value string) (*Element, error)
func (*ElementTree) SubElementWithDecimal ¶ added in v1.1.2
func (*ElementTree) SubElementWithFlag ¶ added in v1.1.2
func (*ElementTree) SubElementWithInt ¶ added in v1.1.2
func (*ElementTree) SubElementWithMappedConstant ¶ added in v1.1.2
func (et *ElementTree) SubElementWithMappedConstant(parent *Element, tagName string, value imappedconstant.IMappedConstant) (*Element, error)
func (*ElementTree) SubElementWithStringConstant ¶ added in v1.1.2
func (et *ElementTree) SubElementWithStringConstant(parent *Element, tagName string, value istringconstant.IStringConstant) (*Element, error)
func (*ElementTree) SubElementWithValue ¶ added in v1.1.2
func (et *ElementTree) SubElementWithValue(parent *Element, tagName, value string) (*Element, error)
type IRequestEncoder ¶
type IRequestEncoder interface {
Encode(interface{}) interface{}
Decode(interface{}) interface{}
}
type JsonDoc ¶
type JsonDoc struct {
// contains filtered or unexported fields
}
func NewJsonDoc ¶
func NewJsonDoc() *JsonDoc
func NewJsonDocWithEncoder ¶
func NewJsonDocWithEncoder(encoder IRequestEncoder) *JsonDoc
func NewJsonDocWithValues ¶
func NewJsonDocWithValuesAndEncoder ¶
func NewJsonDocWithValuesAndEncoder(values map[string]interface{}, encoder IRequestEncoder) *JsonDoc
func ParseBytes ¶
func ParseWithEncoder ¶
func ParseWithEncoder(jsonStr string, encoder IRequestEncoder) (*JsonDoc, error)
func (*JsonDoc) GetIntOrStringAsString ¶
func (*JsonDoc) GetStringArray ¶
func (*JsonDoc) SetEnum ¶
func (jd *JsonDoc) SetEnum(key string, value devicetype.DeviceType, force bool) *JsonDoc
func (*JsonDoc) SetStringArray ¶
type MessageWriter ¶
type MessageWriter struct {
// contains filtered or unexported fields
}
func NewMessageWriter ¶
func NewMessageWriter() *MessageWriter
func NewMessageWriterWithBytes ¶
func NewMessageWriterWithBytes(bytes []byte) *MessageWriter
func (*MessageWriter) Add ¶
func (mw *MessageWriter) Add(b byte)
func (*MessageWriter) AddByteConstant ¶
func (mw *MessageWriter) AddByteConstant(constant ibyteconstant.IByteConstant)
func (*MessageWriter) AddInt ¶
func (mw *MessageWriter) AddInt(value int)
func (*MessageWriter) AddIntWithLength ¶
func (mw *MessageWriter) AddIntWithLength(value int, length int)
func (*MessageWriter) AddRange ¶
func (mw *MessageWriter) AddRange(bytes []byte)
func (*MessageWriter) AddRangePadded ¶
func (mw *MessageWriter) AddRangePadded(fieldValue string, digitCount int)
func (*MessageWriter) AddRangePaddedInt ¶
func (mw *MessageWriter) AddRangePaddedInt(fieldValue int, digitCount int)
func (*MessageWriter) AddString ¶
func (mw *MessageWriter) AddString(value string)
func (*MessageWriter) AddStringConstant ¶
func (mw *MessageWriter) AddStringConstant(constant istringconstant.IStringConstant)
func (*MessageWriter) GetMessageRequest ¶
func (mw *MessageWriter) GetMessageRequest() *strings.Builder
func (*MessageWriter) Length ¶
func (mw *MessageWriter) Length() int
func (*MessageWriter) Pop ¶
func (mw *MessageWriter) Pop()
func (*MessageWriter) SetMessageRequest ¶
func (mw *MessageWriter) SetMessageRequest(messageRequest strings.Builder)
func (*MessageWriter) String ¶
func (mw *MessageWriter) String() string
func (*MessageWriter) ToArray ¶
func (mw *MessageWriter) ToArray() []byte
Click to show internal directories.
Click to hide internal directories.