utils

package
v1.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2025 License: GPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseSingleValue

func ParseSingleValue(jsonStr string, name string) (string, error)

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 FromNode added in v1.1.2

func FromNode(doc, node *xmlquery.Node, namespaces map[string]string) *Element

func NewElement added in v1.1.2

func NewElement(doc, element *xmlquery.Node, namespaces map[string]string) *Element

func (*Element) Append added in v1.1.2

func (e *Element) Append(child *Element) *Element

func (*Element) CData added in v1.1.2

func (e *Element) CData(text string) *Element

func (*Element) FirstChild added in v1.1.2

func (e *Element) FirstChild() *Element

func (*Element) Get added in v1.1.2

func (e *Element) Get(tagName string) *Element

func (*Element) GetAll added in v1.1.2

func (e *Element) GetAll() []*Element

func (*Element) GetAllByTag added in v1.1.2

func (e *Element) GetAllByTag(tagName string) []*Element

func (*Element) GetAttributeString added in v1.1.2

func (e *Element) GetAttributeString(attributeName string) string

func (*Element) GetBool added in v1.1.2

func (e *Element) GetBool(tagName string) (bool, error)

func (*Element) GetDate added in v1.1.2

func (e *Element) GetDate(tagNames ...string) string

func (*Element) GetDateWithFormat added in v1.1.2

func (e *Element) GetDateWithFormat(layout string, tagNames ...string) string

func (*Element) GetDecimal added in v1.1.2

func (e *Element) GetDecimal(tagName string) *decimal.Decimal

func (*Element) GetInt added in v1.1.2

func (e *Element) GetInt(tagName string) *int

func (*Element) GetNode added in v1.1.2

func (e *Element) GetNode() *xmlquery.Node

func (*Element) GetRootDoc added in v1.1.2

func (e *Element) GetRootDoc() *xmlquery.Node

func (*Element) GetString added in v1.1.2

func (e *Element) GetString(tagNames ...string) string

func (*Element) Has added in v1.1.2

func (e *Element) Has(tagName string) bool

func (*Element) Remove added in v1.1.2

func (e *Element) Remove(tagName string) *Element

func (*Element) Set added in v1.1.2

func (e *Element) Set(name, value string) *Element

func (*Element) Tag added in v1.1.2

func (e *Element) Tag() string

func (*Element) Text added in v1.1.2

func (e *Element) Text(text string) *Element

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 (et *ElementTree) SubElementWithDecimal(parent *Element, tagName string, value *decimal.Decimal) (*Element, error)

func (*ElementTree) SubElementWithFlag added in v1.1.2

func (et *ElementTree) SubElementWithFlag(parent *Element, tagName string, value iflag.IFlag) (*Element, error)

func (*ElementTree) SubElementWithInt added in v1.1.2

func (et *ElementTree) SubElementWithInt(parent *Element, tagName string, value int) (*Element, error)

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)

func (*ElementTree) ToString added in v1.1.2

func (et *ElementTree) ToString(root *Element) (string, 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 NewJsonDocWithValues(values map[string]interface{}) *JsonDoc

func NewJsonDocWithValuesAndEncoder

func NewJsonDocWithValuesAndEncoder(values map[string]interface{}, encoder IRequestEncoder) *JsonDoc

func Parse

func Parse(jsonStr string) (*JsonDoc, error)

func ParseBytes

func ParseBytes(jsonBytes []byte) (*JsonDoc, error)

func ParseWithEncoder

func ParseWithEncoder(jsonStr string, encoder IRequestEncoder) (*JsonDoc, error)

func (*JsonDoc) Get

func (jd *JsonDoc) Get(name string) *JsonDoc

func (*JsonDoc) GetArray

func (jd *JsonDoc) GetArray(name string) []*JsonDoc

func (*JsonDoc) GetBool

func (jd *JsonDoc) GetBool(name string) bool

func (*JsonDoc) GetDecimal

func (jd *JsonDoc) GetDecimal(name string) *decimal.Decimal

func (*JsonDoc) GetInt

func (jd *JsonDoc) GetInt(name string) *int

func (*JsonDoc) GetIntOrStringAsString

func (jd *JsonDoc) GetIntOrStringAsString(name string) string

func (*JsonDoc) GetString

func (jd *JsonDoc) GetString(name string) string

func (*JsonDoc) GetStringArray

func (jd *JsonDoc) GetStringArray(name string) []string

func (*JsonDoc) Has

func (jd *JsonDoc) Has(name string) bool

func (*JsonDoc) Remove

func (jd *JsonDoc) Remove(key string) *JsonDoc

func (*JsonDoc) Set

func (jd *JsonDoc) Set(key string, value string, force bool) *JsonDoc

func (*JsonDoc) SetBool

func (jd *JsonDoc) SetBool(key string, value bool) *JsonDoc

func (*JsonDoc) SetEnum

func (jd *JsonDoc) SetEnum(key string, value devicetype.DeviceType, force bool) *JsonDoc

func (*JsonDoc) SetInt

func (jd *JsonDoc) SetInt(key string, value *int) *JsonDoc

func (*JsonDoc) SetIntArray

func (jd *JsonDoc) SetIntArray(key string, values []int) *JsonDoc

func (*JsonDoc) SetJsonDoc

func (jd *JsonDoc) SetJsonDoc(key string, value *JsonDoc) *JsonDoc

func (*JsonDoc) SetStringArray

func (jd *JsonDoc) SetStringArray(key string, values []string) *JsonDoc

func (*JsonDoc) ToString

func (jd *JsonDoc) ToString() (string, error)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL