rendezvous

package
v2.436.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: Apache-2.0, MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultRotationInterval = time.Hour * 24
View Source
const EmitterServiceType = "emitter-io"

Variables

View Source
var (
	RotationGracePeriod  = time.Minute * 10
	MinimumDelayRotation = time.Minute
)

Functions

func GenerateRendezvousPointForPeriod

func GenerateRendezvousPointForPeriod(topic, seed []byte, date time.Time) []byte

func NextTimePeriod

func NextTimePeriod(date time.Time, interval time.Duration) time.Time

func RoundTimePeriod

func RoundTimePeriod(date time.Time, interval time.Duration) time.Time

Types

type EmitterClientOptions added in v2.428.0

type EmitterClientOptions struct {
	Logger *zap.Logger
}

type EmitterOptions added in v2.428.0

type EmitterOptions struct {
	Logger           *zap.Logger
	ServerPublicAddr string
	EmitterOptions   []func(*emitter.Client)
}

type EmitterPubSub added in v2.428.0

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

func NewEmitterServer added in v2.428.0

func NewEmitterServer(serverAddr string, adminKey string, options *EmitterOptions) (*EmitterPubSub, error)

func (*EmitterPubSub) Close added in v2.428.0

func (p *EmitterPubSub) Close() error

func (*EmitterPubSub) GetServiceType added in v2.428.0

func (p *EmitterPubSub) GetServiceType() string

func (*EmitterPubSub) Register added in v2.428.0

func (p *EmitterPubSub) Register(pid peer.ID, ns string, addrs [][]byte, ttlAsSeconds int, counter uint64)

func (*EmitterPubSub) Subscribe added in v2.428.0

func (p *EmitterPubSub) Subscribe(ns string) (string, error)

func (*EmitterPubSub) Unregister added in v2.428.0

func (p *EmitterPubSub) Unregister(_ peer.ID, _ string)

type EmitterPubSubSubscriptionDetails added in v2.428.0

type EmitterPubSubSubscriptionDetails struct {
	ServerAddr  string
	ReadKey     string
	ChannelName string
}

type Point added in v2.367.0

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

func (*Point) Deadline added in v2.367.0

func (p *Point) Deadline() time.Time

func (*Point) IsExpired added in v2.367.0

func (p *Point) IsExpired() bool

func (*Point) NextPoint added in v2.367.0

func (p *Point) NextPoint() *Point

func (*Point) RawRotationTopic added in v2.367.0

func (p *Point) RawRotationTopic() []byte

func (*Point) RawTopic added in v2.367.0

func (p *Point) RawTopic() []byte

func (*Point) RotationTopic added in v2.367.0

func (p *Point) RotationTopic() string

func (*Point) Seed added in v2.367.0

func (p *Point) Seed() []byte

func (*Point) TTL added in v2.367.0

func (p *Point) TTL() time.Duration

func (*Point) Topic added in v2.367.0

func (p *Point) Topic() string

type RotationInterval added in v2.367.0

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

func NewRotationInterval added in v2.367.0

func NewRotationInterval(interval time.Duration) *RotationInterval

func NewStaticRotationInterval added in v2.367.0

func NewStaticRotationInterval() *RotationInterval

func (*RotationInterval) NewRendezvousPointForPeriod added in v2.367.0

func (r *RotationInterval) NewRendezvousPointForPeriod(at time.Time, topic string, seed []byte) (point *Point)

func (*RotationInterval) NextTimePeriod added in v2.367.0

func (r *RotationInterval) NextTimePeriod(at time.Time) time.Time

func (*RotationInterval) PointForRawRotation added in v2.367.0

func (r *RotationInterval) PointForRawRotation(rotation []byte) (*Point, error)

func (*RotationInterval) PointForRotation added in v2.367.0

func (r *RotationInterval) PointForRotation(rotation string) (*Point, error)

func (*RotationInterval) PointForTopic added in v2.367.0

func (r *RotationInterval) PointForTopic(topic string) (*Point, error)

func (*RotationInterval) RegisterRotation added in v2.367.0

func (r *RotationInterval) RegisterRotation(at time.Time, topic string, seed []byte)

func (*RotationInterval) RoundTimePeriod added in v2.367.0

func (r *RotationInterval) RoundTimePeriod(at time.Time) time.Time

type SyncClient added in v2.436.0

type SyncClient interface {
	rendezvous.RendezvousSyncClient

	io.Closer
}

func NewEmitterClient added in v2.428.0

func NewEmitterClient(opts *EmitterClientOptions) SyncClient

Jump to

Keyboard shortcuts

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