estream

package
v0.0.0-...-ebda94a Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const (
	RecvStateDisconnected = iota
	RecvStateActive
	RecvStateSuspended
	RecvStateConnecting
)
View Source
const (
	SubStateValid = iota
	SubStateInvalid
	SubStateConcluded
)

Variables

View Source
var ErrBufferOverflow = errors.New("event buffer full")

Functions

func Manage

func Manage(s *Service) node.Node

Manage is implementation of ietf-subscribed-notifications.yang

Types

type EstablishRequest

type EstablishRequest struct {
	Stream           string
	StreamFilterName string
	ReplayStartTime  time.Time
	StopTime         time.Time
}

type Filter

type Filter struct {
	Name   string
	Filter func(*node.Selection) *node.Selection
}

func (Filter) Empty

func (f Filter) Empty() bool

type ModifyRequest

type ModifyRequest struct {
	SubscriptionId   string
	StreamFilterName string
	StopTime         time.Time
}

type Receiver

type Receiver func(e ReceiverEvent) error

type ReceiverEvent

type ReceiverEvent struct {
	Name      string
	EventTime time.Time
	Event     *node.Selection
}

type RecvState

type RecvState int

type Service

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

func NewService

func NewService() *Service

func (*Service) AddFilter

func (s *Service) AddFilter(f Filter)

func (*Service) AddStream

func (s *Service) AddStream(stream Stream)

func (*Service) DeleteSubsccription

func (s *Service) DeleteSubsccription(subId string) error

func (*Service) EstablishSubscription

func (s *Service) EstablishSubscription(req EstablishRequest) (*Subscription, error)

func (*Service) KillSubscription

func (s *Service) KillSubscription(subId string) error

func (*Service) ModifySubscription

func (s *Service) ModifySubscription(req ModifyRequest) error

type Stream

type Stream struct {
	Name                  string
	Description           string
	ReplaySupport         bool
	ReplayLogCreationTime time.Time
	ReplayLogAgedTime     time.Time
	Open                  func() (*node.Selection, error)
}

type SubEvent

type SubEvent struct {
	EventId      SubEventType
	Subscription *Subscription
	Reason       string
}

type SubEventType

type SubEventType int
const (
	SubEventSuspended SubEventType = iota
	SubEventTerminated
	SubEventCompleted
	SubEventModified
	SubEventResumed
	SubEventStarted
)

type SubState

type SubState int

type Subscription

type Subscription struct {
	Id string

	ConfiguredSubscriptionState SubState
	Recievers                   map[string]*receiverEntry
	// contains filtered or unexported fields
}

func NewSubscription

func NewSubscription(id string, service subService) *Subscription

func (*Subscription) AddReceiver

func (s *Subscription) AddReceiver(name string, receiver Receiver) error

func (*Subscription) Apply

func (s *Subscription) Apply(opts SubscriptionOptions) error

func (*Subscription) Options

func (s *Subscription) Options() SubscriptionOptions

func (*Subscription) RemoveReceiver

func (s *Subscription) RemoveReceiver(name string) error

type SubscriptionOptions

type SubscriptionOptions struct {
	Filter          Filter
	Stream          Stream
	ReplayStartTime time.Time
	// configured-replay
	ReplayStartTimeRevision time.Time
	StopTime                time.Time
	// transport
	// encoding
	Purpose       string
	SourceAddress string
}

Jump to

Keyboard shortcuts

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