constructeddata

package
v0.0.0-...-0b1a56d Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayOfE

func ArrayOfE[T any](klass func(arg Arg) (*T, error), fixedLength int, prototype any) func(Args, KWArgs) (ElementKlass, error)

func ArrayOfEs

func ArrayOfEs[T any](klass func(args Args) (*T, error), fixedLength int, prototype any) func(Args, KWArgs) (ElementKlass, error)

TODO: finish // convert to kwArgs and check wtf we are doing here...

func ListOfE

func ListOfE[T any](b func(arg Arg) (*T, error)) func(Args) (*T, error)

TODO: finish // convert to kwArgs and check wtf we are doing here...

func SequenceOfE

func SequenceOfE[T any](klass func(arg Arg) (*T, error)) func(Args, KWArgs) (ElementKlass, error)

func SequenceOfEs

func SequenceOfEs[T any](klass func(args Args) (*T, error)) func(Args, KWArgs) (ElementKlass, error)

func V2E

func V2E[T any](b func(arg Arg) (*T, error)) func(Args, KWArgs) (ElementKlass, error)

V2E accepts a function which takes an Arg and maps it to a ElementKlass

func Vs2E

func Vs2E[T any](b func(args Args) (*T, error)) func(Args, KWArgs) (ElementKlass, error)

Vs2E accepts a function which takes an Args and maps it to a ElementKlass

func WithAnyContract

func WithAnyContract(contract AnyContract) func(*Any)

func WithChoiceExtension

func WithChoiceExtension(contract ChoiceContractRequirement) GenericApplier[*Choice]

func WithElementContext

func WithElementContext(context int) GenericApplier[*_Element]

func WithElementOptional

func WithElementOptional(optional bool) GenericApplier[*_Element]

func WithSequenceExtension

func WithSequenceExtension(contract SequenceContractRequirement) GenericApplier[*Sequence]

Types

type Any

type Any struct {
	// contains filtered or unexported fields
}

func NewAny

func NewAny(args Args) (*Any, error)

func (*Any) Decode

func (a *Any) Decode(tagList TagList) error

func (*Any) Encode

func (a *Any) Encode(tagList TagList) error

type AnyAtomic

type AnyAtomic struct {
	// contains filtered or unexported fields
}

TODO: finish me

func NewAnyAtomic

func NewAnyAtomic(args Args) (*AnyAtomic, error)

func (*AnyAtomic) Decode

func (a *AnyAtomic) Decode(arg Arg) error

func (*AnyAtomic) Encode

func (a *AnyAtomic) Encode(arg Arg)

func (*AnyAtomic) GetValue

func (a *AnyAtomic) GetValue() any

type AnyContract

type AnyContract interface {
	Encode(taglist TagList) error
	Decode(taglist TagList) error
	// contains filtered or unexported methods
}

type Array

type Array struct {
}

type Choice

type Choice struct {
	// contains filtered or unexported fields
}

func NewChoice

func NewChoice(args Args, kwArgs KWArgs, options ...Option) (*Choice, error)

func (*Choice) Decode

func (c *Choice) Decode(arg Arg) error

func (*Choice) Encode

func (c *Choice) Encode(arg Arg) error

func (*Choice) GetAttr

func (c *Choice) GetAttr(key string) (any, bool)

func (*Choice) GetChoiceElements

func (c *Choice) GetChoiceElements() []Element

func (*Choice) PrintDebugContents

func (c *Choice) PrintDebugContents(indent int, file io.Writer, _ids []uintptr)

type ChoiceContract

type ChoiceContract interface {
	GetChoiceElements() []Element
}

ChoiceContract provides a set of functions which can be overwritten by a sub struct

type ChoiceContractRequirement

type ChoiceContractRequirement interface {
	ChoiceContract
	// SetChoice callback is needed as we work in the constructor already with the finished object // TODO: maybe we need to return as init again as it might not be finished constructing....
	SetChoice(s *Choice)
}

ChoiceContractRequirement is needed when one want to extend using ChoiceContract

type Element

type Element interface {
	fmt.Formatter
	GetName() string
	GetKlass() func(Args, KWArgs) (ElementKlass, error)
	GetContext() *int
	IsOptional() bool
	Encode(tagList Arg) error
}

func NewElement

func NewElement(name string, klass func(Args, KWArgs) (ElementKlass, error), options ...Option) Element

type ElementKlass

type ElementKlass interface {
	Encode(Arg) error
	GetAppTag() readWriteModel.BACnetDataType
}

type IsAnyAtomic

type IsAnyAtomic interface {
	// contains filtered or unexported methods
}

type List

type List struct {
}

TODO: finish

type Sequence

type Sequence struct {
	// contains filtered or unexported fields
}

func NewSequence

func NewSequence(args Args, kwArgs KWArgs, options ...Option) (*Sequence, error)

NewSequence Create a sequence element, optionally providing attribute/property values.

func (*Sequence) Decode

func (a *Sequence) Decode(arg Arg) error

func (*Sequence) Encode

func (a *Sequence) Encode(arg Arg) error

func (*Sequence) GetAttr

func (a *Sequence) GetAttr(key string) (any, bool)

func (*Sequence) GetSequenceElements

func (a *Sequence) GetSequenceElements() []Element

func (*Sequence) PrintDebugContents

func (a *Sequence) PrintDebugContents(indent int, file io.Writer, _ids []uintptr)

type SequenceContract

type SequenceContract interface {
	GetSequenceElements() []Element
}

SequenceContract provides a set of functions which can be overwritten by a sub struct

type SequenceContractRequirement

type SequenceContractRequirement interface {
	SequenceContract
	// SetSequence callback is needed as we work in the constructor already with the finished object // TODO: maybe we need to return as init again as it might not be finished constructing....
	SetSequence(s *Sequence)
}

SequenceContractRequirement is needed when one want to extend using SequenceContract

type SequenceOfAny

type SequenceOfAny struct {
}

TODO: finish

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳