presences

package
v0.0.0-...-6d36bb5 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MOST_UNIQUE_PRESENCES_PER_IP = 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelPresenceFanoutOptions

type ChannelPresenceFanoutOptions struct {
	Presence structures.UserPresence[structures.UserPresenceDataChannel]
	Whisper  string
	Passive  bool
}

type Instance

type Instance interface {
	// ChannelPresence returns a PresenceManager for the given actorID, with only Channel presence data.
	ChannelPresence(ctx context.Context, actorID primitive.ObjectID) PresenceManager[structures.UserPresenceDataChannel]
	ChannelPresenceFanout(ctx context.Context, opt ChannelPresenceFanoutOptions) error
}

func New

func New(opt Options) Instance

type Options

type Options struct {
	Mongo   mongo.Instance
	Loaders loaders.Instance
	Events  events.Instance
	Config  *configure.Config

	Modelizer model.Modelizer
}

type PresenceManager

type PresenceManager[T structures.UserPresenceData] interface {
	Items() []structures.UserPresence[T]
	Write(ctx context.Context, ttl time.Duration, data T, opt WritePresenceOptions) (structures.UserPresence[T], error)
}

type WritePresenceOptions

type WritePresenceOptions struct {
	Authentic bool
	Known     bool
	IP        string
	Passive   bool
}

Jump to

Keyboard shortcuts

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