centrifugo

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ErrIgnoredChannel = channelError("channel ignored")

ErrIgnoredChannel is returned when the chennel is to be ignored.

View Source
const HeartbeatChannel = "heartbeat"

HeartbeatChannel is theCentrifugo channel name for heartbeat messages.

View Source
const NsSeparator = ":"

NsSeparator is the channel namespace boundary character.

Variables

This section is empty.

Functions

func PublishStatus added in v0.5.0

func PublishStatus(ctx context.Context, ns string, s StateProvider, p Publisher) error

PublishStatus publishes the status of the service to Centrifugo heartbeat channel.

Types

type Channel

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

Channel represents a Centrifugo channel suitable for OPC-UA use.

func ParseChannel

func ParseChannel(s, namespace string) (*Channel, error)

ParseChannel parses a Centrifugo channel and creates a Channel structure.

See "Specifications" section in README.md for the format of the channel.

func (*Channel) Interval

func (c *Channel) Interval() time.Duration

Interval returns the channel interval.

func (*Channel) Name

func (c *Channel) Name() string

Name returns the channel name.

func (*Channel) String

func (c *Channel) String() string

String returns the string representation of the channel.

type Publisher added in v0.5.0

type Publisher interface {
	Publish(ctx context.Context, channel string, data []byte, opts ...gocent.PublishOption) (gocent.PublishResult, error)
}

Publisher is a consumer contract modelling a Centrifugo publisher.

type StateProvider added in v0.5.0

type StateProvider interface {
	State() opcua.ConnState
}

StateProvider is a consumer contract modelling an OPC-UA client.

Jump to

Keyboard shortcuts

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