Documentation ¶
Index ¶
- Variables
- func IntToBytes(n int, byteCount int) []byte
- func MongoAuthURL() (string, error)
- type ActionType
- type AuthInfo
- type AuthParserProtocol
- type Authenticator
- type BinaryAuthContentMessage
- type BinaryAuthContentProtocol
- type Config
- type Container
- type ContainerWriter
- type JWTAuthenticator
- type JWTAuthenticatorOpts
- type Maestro
- type Message
- type MongoChangeEvent
- type MongoWatcher
- type MongoWatcherOpts
- type NilAuthenticator
- type OpType
- type Parser
- type Peer
- type PeerMap
- type Protocol
- type Queue
- type QueueConfig
- type QueueItem
- type QueueUpdateMessage
- type Server
- type ServerOpts
- type SliceContainer
- type Watcher
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrQueueEmpty = errors.New("queue is empty") ErrItemNotFound = errors.New("item not found") )
View Source
var ErrInvalidTerminator = errors.New("invalid terminator")
Functions ¶
func IntToBytes ¶
func MongoAuthURL ¶
MongoAuthURL constructs a MongoDB connection string from environment variables.
Types ¶
type ActionType ¶
type ActionType string
const ( ActionTypeAcknowledge ActionType = "acknowledge" ActionTypeSubscribe ActionType = "subscribe" )
type AuthParserProtocol ¶
type AuthParserProtocol struct { Authenticator Authenticator Parser Parser }
type Authenticator ¶
type BinaryAuthContentProtocol ¶
type BinaryAuthContentProtocol struct { Authenticator Authenticator Parser Parser }
func (*BinaryAuthContentProtocol) Authenticate ¶
func (au *BinaryAuthContentProtocol) Authenticate(m AuthInfo) (AuthInfo, error)
func (*BinaryAuthContentProtocol) Parse ¶
func (au *BinaryAuthContentProtocol) Parse(data any) (Message, error)
func (*BinaryAuthContentProtocol) ParseIncoming ¶
func (au *BinaryAuthContentProtocol) ParseIncoming(data any) (Message, error)
type ContainerWriter ¶
type JWTAuthenticator ¶
type JWTAuthenticator struct {
Opts JWTAuthenticatorOpts
}
func NewJWTAuthenticator ¶
func NewJWTAuthenticator(opts JWTAuthenticatorOpts) *JWTAuthenticator
func (*JWTAuthenticator) Authenticate ¶
func (j *JWTAuthenticator) Authenticate(data any) (AuthInfo, error)
Authenticate takes a token string and returns the claims if the token is valid
type JWTAuthenticatorOpts ¶
type Message ¶
type Message struct { Content interface{} ConnID string ActionType ActionType }
type MongoChangeEvent ¶
type MongoWatcher ¶
type MongoWatcher struct {
// contains filtered or unexported fields
}
func NewMongoWatcher ¶
func NewMongoWatcher(client *mongo.Client, opts MongoWatcherOpts) (*MongoWatcher, error)
func (*MongoWatcher) Watch ¶
func (mw *MongoWatcher) Watch(ctx context.Context, c chan QueueUpdateMessage) error
type MongoWatcherOpts ¶
type NilAuthenticator ¶
type NilAuthenticator struct{}
func NewNilAuthenticator ¶
func NewNilAuthenticator() *NilAuthenticator
func (*NilAuthenticator) Authenticate ¶
func (na *NilAuthenticator) Authenticate(any) (AuthInfo, error)
type PeerMap ¶
type PeerMap struct {
// contains filtered or unexported fields
}
func NewPeerMap ¶
func NewPeerMap() *PeerMap
func (*PeerMap) RemovePeer ¶
type Protocol ¶
type Protocol interface { Authenticator Parser ParseIncoming(data any) (Message, error) }
type Queue ¶
type Queue struct { Container Container Writer ContainerWriter Cfg QueueConfig Name string }
type QueueConfig ¶
type QueueConfig struct{}
type QueueUpdateMessage ¶
type ServerOpts ¶
type SliceContainer ¶
type SliceContainer struct {
Elements []QueueItem
}
func NewSliceContainer ¶
func NewSliceContainer() *SliceContainer
func (*SliceContainer) Items ¶
func (sc *SliceContainer) Items() []QueueItem
func (*SliceContainer) Len ¶
func (sc *SliceContainer) Len() int
func (*SliceContainer) Pop ¶
func (sc *SliceContainer) Pop() (QueueItem, error)
func (*SliceContainer) Push ¶
func (sc *SliceContainer) Push(item QueueItem)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.