Documentation ¶
Index ¶
- Variables
- func ProtocolFactory(ptype ProtocolType, conf *thrift.TConfiguration) thrift.TProtocolFactory
- func ReadData[T any](ctx context.Context, t TData[T]) (err error)
- func ReadDataGeneric(ctx context.Context, t TDataSpec, value *any) (err error)
- func String2bs(s string) (r []byte)
- func WriteData[T any](ctx context.Context, t TData[T]) (err error)
- func WriteDataGeneric(ctx context.Context, t TDataSpec, value any) (err error)
- type Container
- type Decoder
- type Encoder
- type ProtocolType
- type RPCStruct
- type Sliceable
- type TData
- type TDataSpec
- type TField
- func (f TField) GetID() TFieldID
- func (f *TField) GetValue() any
- func (f *TField) Read(ctx context.Context, p thrift.TProtocol) (err error)
- func (f *TField) SetValue(value any) *TField
- func (f *TField) Write(ctx context.Context, p thrift.TProtocol) (err error)
- func (f *TField) WriteData(ctx context.Context, p thrift.TProtocol) (err error)
- type TFieldID
- type TFieldImplementerx
- type TypeContainer
- type TypeContainerDesc
- type TypeContainerImplementer
- func NewTypeContainerListOfTType(desc TypeContainerDesc, required bool) (TypeContainerImplementer, error)
- func NewTypeContainerMapOfTType(desc TypeContainerDesc, required bool) (TypeContainerImplementer, error)
- func NewTypeContainerMapUnorderedOfTType(desc TypeContainerDesc, required bool) (TypeContainerImplementer, error)
- func NewTypeContainerSetOfTType(desc TypeContainerDesc, required bool) (TypeContainerImplementer, error)
- type TypeContainerList
- func (t *TypeContainerList[T]) Add(vs ...T)
- func (t *TypeContainerList[T]) GetSize() int
- func (t *TypeContainerList[T]) Read(ctx context.Context, p thrift.TProtocol) (err error)
- func (t *TypeContainerList[T]) SetSize(v int)
- func (t *TypeContainerList[T]) Write(ctx context.Context, p thrift.TProtocol) (err error)
- type TypeContainerMap
- func (t *TypeContainerMap[K, V]) Add(vs ...TypeContainerMapItem[K, V])
- func (t *TypeContainerMap[K, V]) AddKV(key K, value V)
- func (t *TypeContainerMap[K, V]) FromMap(m map[K]V)
- func (t *TypeContainerMap[K, V]) FromMapOrdered(m map[K]V)
- func (t *TypeContainerMap[K, V]) GetSize() int
- func (t *TypeContainerMap[K, V]) Read(ctx context.Context, p thrift.TProtocol) (err error)
- func (t *TypeContainerMap[K, V]) SetSize(v int)
- func (t *TypeContainerMap[K, V]) ToMap() map[K]V
- func (t *TypeContainerMap[K, V]) ToMapPtr() map[K]*V
- func (t *TypeContainerMap[K, V]) Write(ctx context.Context, p thrift.TProtocol) (err error)
- type TypeContainerMapItem
- type TypeContainerMapUnordered
- func (t *TypeContainerMapUnordered[K, V]) AddKV(key K, value V)
- func (t *TypeContainerMapUnordered[K, V]) FromMap(m map[K]V)
- func (t *TypeContainerMapUnordered[K, V]) GetSize() int
- func (t *TypeContainerMapUnordered[K, V]) Read(ctx context.Context, p thrift.TProtocol) (err error)
- func (t *TypeContainerMapUnordered[K, V]) SetSize(v int)
- func (t *TypeContainerMapUnordered[K, V]) ToMap() map[K]V
- func (t *TypeContainerMapUnordered[K, V]) Write(ctx context.Context, p thrift.TProtocol) (err error)
- type TypeContainerSet
- func (t *TypeContainerSet[T]) Add(vs ...T)
- func (t *TypeContainerSet[T]) GetSize() int
- func (t *TypeContainerSet[T]) Read(ctx context.Context, p thrift.TProtocol) (err error)
- func (t *TypeContainerSet[T]) SetSize(v int)
- func (t *TypeContainerSet[T]) Write(ctx context.Context, p thrift.TProtocol) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidContainerItem = errors.New("invalid container type item")
)
View Source
var (
ErrSkipField = errors.New("skip field")
)
View Source
var ProtocolType_VALUES = []ProtocolType{ ProtocolType_Compact, ProtocolType_Binary, ProtocolType_SimpleJSON, ProtocolType_JSON, }
View Source
var (
TTypeToReflectType [_BT_SIZE]reflect.Type
)
Functions ¶
func ProtocolFactory ¶
func ProtocolFactory(ptype ProtocolType, conf *thrift.TConfiguration) thrift.TProtocolFactory
func ReadDataGeneric ¶ added in v0.2.0
Types ¶
type Decoder ¶ added in v0.2.0
type Decoder struct {
// contains filtered or unexported fields
}
func NewDecoder ¶ added in v0.2.0
func NewDecoder(pf thrift.TProtocolFactory) *Decoder
type Encoder ¶ added in v0.2.0
type Encoder struct {
// contains filtered or unexported fields
}
func NewEncoder ¶ added in v0.2.0
func NewEncoder(pf thrift.TProtocolFactory) *Encoder
type ProtocolType ¶
type ProtocolType = string
const ( ProtocolType_Compact ProtocolType = "tcompact" ProtocolType_Binary ProtocolType = "tbinary" ProtocolType_SimpleJSON ProtocolType = "tsimplejson" ProtocolType_JSON ProtocolType = "tjson" )
type TField ¶
type TField struct { ID TFieldID // i16 Type thrift.TType // i8 Required bool // i8 Name string Value any }
type TFieldImplementerx ¶
type TypeContainer ¶
func (*TypeContainer) GetSize ¶
func (t *TypeContainer) GetSize() int
func (*TypeContainer) GetValue ¶
func (t *TypeContainer) GetValue() any
func (*TypeContainer) Init ¶ added in v0.2.0
func (t *TypeContainer) Init() *TypeContainer
func (*TypeContainer) SetSize ¶
func (t *TypeContainer) SetSize(sz int)
type TypeContainerImplementer ¶
type TypeContainerImplementer interface { SetSize(v int) GetSize() int Read(ctx context.Context, p thrift.TProtocol) (err error) Write(ctx context.Context, p thrift.TProtocol) (err error) }
func NewTypeContainerListOfTType ¶ added in v0.2.0
func NewTypeContainerListOfTType(desc TypeContainerDesc, required bool) (TypeContainerImplementer, error)
func NewTypeContainerMapOfTType ¶ added in v0.2.0
func NewTypeContainerMapOfTType(desc TypeContainerDesc, required bool) (TypeContainerImplementer, error)
func NewTypeContainerMapUnorderedOfTType ¶ added in v0.2.1
func NewTypeContainerMapUnorderedOfTType(desc TypeContainerDesc, required bool) (TypeContainerImplementer, error)
func NewTypeContainerSetOfTType ¶ added in v0.2.0
func NewTypeContainerSetOfTType(desc TypeContainerDesc, required bool) (TypeContainerImplementer, error)
type TypeContainerList ¶
type TypeContainerList[T Sliceable] struct { Required bool Desc TypeContainerDesc Size int Value []T }
func NewTypeContainerList ¶
func NewTypeContainerList[T Sliceable](desc TypeContainerDesc, required bool) *TypeContainerList[T]
func (*TypeContainerList[T]) Add ¶ added in v0.2.0
func (t *TypeContainerList[T]) Add(vs ...T)
func (*TypeContainerList[T]) GetSize ¶ added in v0.2.0
func (t *TypeContainerList[T]) GetSize() int
func (*TypeContainerList[T]) SetSize ¶ added in v0.2.0
func (t *TypeContainerList[T]) SetSize(v int)
type TypeContainerMap ¶
type TypeContainerMap[K comparable, V any] struct { Required bool Desc TypeContainerDesc Size int Value []TypeContainerMapItem[K, V] }
func NewTypeContainerMap ¶
func NewTypeContainerMap[K comparable, V any](desc TypeContainerDesc, required bool) *TypeContainerMap[K, V]
func (*TypeContainerMap[K, V]) Add ¶ added in v0.2.0
func (t *TypeContainerMap[K, V]) Add(vs ...TypeContainerMapItem[K, V])
func (*TypeContainerMap[K, V]) AddKV ¶ added in v0.2.0
func (t *TypeContainerMap[K, V]) AddKV(key K, value V)
func (*TypeContainerMap[K, V]) FromMap ¶ added in v0.2.0
func (t *TypeContainerMap[K, V]) FromMap(m map[K]V)
FromMap *copy* map to value
func (*TypeContainerMap[K, V]) FromMapOrdered ¶ added in v0.2.0
func (t *TypeContainerMap[K, V]) FromMapOrdered(m map[K]V)
FromMapOrdered *copy* map to value
func (*TypeContainerMap[K, V]) GetSize ¶ added in v0.2.0
func (t *TypeContainerMap[K, V]) GetSize() int
func (*TypeContainerMap[K, V]) SetSize ¶ added in v0.2.0
func (t *TypeContainerMap[K, V]) SetSize(v int)
func (*TypeContainerMap[K, V]) ToMap ¶ added in v0.2.0
func (t *TypeContainerMap[K, V]) ToMap() map[K]V
func (*TypeContainerMap[K, V]) ToMapPtr ¶ added in v0.2.0
func (t *TypeContainerMap[K, V]) ToMapPtr() map[K]*V
type TypeContainerMapItem ¶ added in v0.2.0
type TypeContainerMapItem[K comparable, V any] struct { Key K Value V }
type TypeContainerMapUnordered ¶ added in v0.2.1
type TypeContainerMapUnordered[K comparable, V any] struct { Required bool Desc TypeContainerDesc Size int Value map[K]V }
func NewTypeContainerMapUnordered ¶ added in v0.2.1
func NewTypeContainerMapUnordered[K comparable, V any](desc TypeContainerDesc, required bool) *TypeContainerMapUnordered[K, V]
func (*TypeContainerMapUnordered[K, V]) AddKV ¶ added in v0.2.1
func (t *TypeContainerMapUnordered[K, V]) AddKV(key K, value V)
func (*TypeContainerMapUnordered[K, V]) FromMap ¶ added in v0.2.1
func (t *TypeContainerMapUnordered[K, V]) FromMap(m map[K]V)
func (*TypeContainerMapUnordered[K, V]) GetSize ¶ added in v0.2.1
func (t *TypeContainerMapUnordered[K, V]) GetSize() int
func (*TypeContainerMapUnordered[K, V]) SetSize ¶ added in v0.2.1
func (t *TypeContainerMapUnordered[K, V]) SetSize(v int)
func (*TypeContainerMapUnordered[K, V]) ToMap ¶ added in v0.2.1
func (t *TypeContainerMapUnordered[K, V]) ToMap() map[K]V
type TypeContainerSet ¶
type TypeContainerSet[T Sliceable] struct { Required bool Desc TypeContainerDesc Size int Value []T }
func NewTypeContainerSet ¶
func NewTypeContainerSet[T Sliceable](desc TypeContainerDesc, required bool) *TypeContainerSet[T]
func (*TypeContainerSet[T]) Add ¶ added in v0.2.0
func (t *TypeContainerSet[T]) Add(vs ...T)
func (*TypeContainerSet[T]) GetSize ¶ added in v0.2.0
func (t *TypeContainerSet[T]) GetSize() int
func (*TypeContainerSet[T]) SetSize ¶ added in v0.2.0
func (t *TypeContainerSet[T]) SetSize(v int)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.