svs

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Generated by the generator, DO NOT modify manually

Index

Constants

This section is empty.

Variables

View Source
var SvsNodeDesc *schema.NodeImplDesc

Functions

func CreateSvsNode

func CreateSvsNode(node *schema.Node) schema.NodeImpl

Types

type MissingData

type MissingData struct {
	NodeId   []byte
	StartSeq uint64
	EndSeq   uint64
}

type StateVec

type StateVec struct {
	//+field:sequence:*StateVecEntry:struct:StateVecEntry
	Entries []*StateVecEntry `tlv:"0xca"`
}

func ParseStateVec

func ParseStateVec(reader enc.ParseReader, ignoreCritical bool) (*StateVec, error)

func (*StateVec) Bytes

func (value *StateVec) Bytes() []byte

func (*StateVec) Encode

func (value *StateVec) Encode() enc.Wire

type StateVecAppParam

type StateVecAppParam struct {
	//+field:struct:StateVec
	Entries []*StateVec `tlv:"0xc9"`
}

func ParseStateVecAppParam added in v0.0.4

func ParseStateVecAppParam(reader enc.ParseReader, ignoreCritical bool) (*StateVecAppParam, error)

func (*StateVecAppParam) Bytes added in v0.0.4

func (value *StateVecAppParam) Bytes() []byte

func (*StateVecAppParam) Encode added in v0.0.4

func (value *StateVecAppParam) Encode() enc.Wire

type StateVecAppParamEncoder added in v0.0.4

type StateVecAppParamEncoder struct {
	Entries_encoder StateVecEncoder
	// contains filtered or unexported fields
}

func (*StateVecAppParamEncoder) Encode added in v0.0.4

func (encoder *StateVecAppParamEncoder) Encode(value *StateVecAppParam) enc.Wire

func (*StateVecAppParamEncoder) EncodeInto added in v0.0.4

func (encoder *StateVecAppParamEncoder) EncodeInto(value *StateVecAppParam, buf []byte)

func (*StateVecAppParamEncoder) Init added in v0.0.4

func (encoder *StateVecAppParamEncoder) Init(value *StateVecAppParam)

type StateVecAppParamParsingContext added in v0.0.4

type StateVecAppParamParsingContext struct {
	Entries_context StateVecParsingContext
}

func (*StateVecAppParamParsingContext) Init added in v0.0.4

func (context *StateVecAppParamParsingContext) Init()

func (*StateVecAppParamParsingContext) Parse added in v0.0.4

func (context *StateVecAppParamParsingContext) Parse(reader enc.ParseReader, ignoreCritical bool) (*StateVecAppParam, error)

type StateVecEncoder

type StateVecEncoder struct {
	Entries_subencoder []struct {
		Entries_encoder StateVecEntryEncoder
	}
	// contains filtered or unexported fields
}

func (*StateVecEncoder) Encode

func (encoder *StateVecEncoder) Encode(value *StateVec) enc.Wire

func (*StateVecEncoder) EncodeInto

func (encoder *StateVecEncoder) EncodeInto(value *StateVec, buf []byte)

func (*StateVecEncoder) Init

func (encoder *StateVecEncoder) Init(value *StateVec)

type StateVecEntry

type StateVecEntry struct {
	//+field:binary
	NodeId []byte `tlv:"0x07"`
	//+field:natural
	SeqNo uint64 `tlv:"0xcc"`
}

func ParseStateVecEntry

func ParseStateVecEntry(reader enc.ParseReader, ignoreCritical bool) (*StateVecEntry, error)

func (*StateVecEntry) Bytes

func (value *StateVecEntry) Bytes() []byte

func (*StateVecEntry) Encode

func (value *StateVecEntry) Encode() enc.Wire

type StateVecEntryEncoder

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

func (*StateVecEntryEncoder) Encode

func (encoder *StateVecEntryEncoder) Encode(value *StateVecEntry) enc.Wire

func (*StateVecEntryEncoder) EncodeInto

func (encoder *StateVecEntryEncoder) EncodeInto(value *StateVecEntry, buf []byte)

func (*StateVecEntryEncoder) Init

func (encoder *StateVecEntryEncoder) Init(value *StateVecEntry)

type StateVecEntryParsingContext

type StateVecEntryParsingContext struct {
}

func (*StateVecEntryParsingContext) Init

func (context *StateVecEntryParsingContext) Init()

func (*StateVecEntryParsingContext) Parse

func (context *StateVecEntryParsingContext) Parse(reader enc.ParseReader, ignoreCritical bool) (*StateVecEntry, error)

type StateVecParsingContext

type StateVecParsingContext struct {
	Entries_context StateVecEntryParsingContext
}

func (*StateVecParsingContext) Init

func (context *StateVecParsingContext) Init()

func (*StateVecParsingContext) Parse

func (context *StateVecParsingContext) Parse(reader enc.ParseReader, ignoreCritical bool) (*StateVec, error)

type SvsNode

type SvsNode struct {
	schema.BaseNodeImpl

	OnMissingData *schema.EventTarget

	SyncInterval        time.Duration
	SuppressionInterval time.Duration
	BaseMatching        enc.Matching
	ChannelSize         uint64
	SelfNodeId          []byte
	// contains filtered or unexported fields
}

SvsNode implements the StateVectorSync but works for only one instance. Similar is RegisterPolicy. A better implementation is needed if there is a need that multiple producers under the same name pattern that runs on the same application instance. It would also be more natural if we make 1-1 mapping between MatchedNodes and SVS instances, instead of the Node and the SVS instance, which is against the philosophy of matching. Also, this sample always starts from sequence number 0.

func (*SvsNode) CastTo

func (n *SvsNode) CastTo(ptr any) any

func (*SvsNode) GetDataName

func (n *SvsNode) GetDataName(mNode schema.MatchedNode, nodeId []byte, seq uint64) enc.Name

func (*SvsNode) MissingDataChannel

func (n *SvsNode) MissingDataChannel() chan MissingData

func (*SvsNode) MySequence

func (n *SvsNode) MySequence() uint64

func (*SvsNode) NewData

func (n *SvsNode) NewData(mNode schema.MatchedNode, content enc.Wire) enc.Wire

func (*SvsNode) NodeImplTrait

func (n *SvsNode) NodeImplTrait() schema.NodeImpl

type SyncState

type SyncState int
const (
	SyncSteady SyncState = iota
	SyncSupression
)

Jump to

Keyboard shortcuts

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