wampproto

package module
v0.0.0-...-86b207b Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 15 Imported by: 6

README

wampproto-go

Documentation

Index

Constants

View Source
const (
	AcceptorStateNone acceptorState = iota
	AcceptorStateChallengeSent
	AcceptorStateWelcomeSent
)
View Source
const (
	OptionReceiveProgress = "receive_progress"
	OptionProgress        = "progress"
	OptionMatch           = "match"
	OptionInvoke          = "invoke"

	MatchExact    = "exact"
	MatchPrefix   = "prefix"
	MatchWildcard = "wildcard"

	InvokeSingle     = "single"
	InvokeFirst      = "first"
	InvokeLast       = "last"
	InvokeRoundRobin = "roundrobin"
	InvokeRandom     = "random"
)
View Source
const (
	FeatureProgressiveCallInvocations = "progressive_call_invocations"
	FeatureProgressiveCallResults     = "progressive_call_results"
	FeatureCallCancelling             = "call_canceling"
	FeaturePublisherExclusion         = "publisher_exclusion"
)
View Source
const (
	CloseGoodByeAndOut  = "wamp.close.goodbye_and_out"
	CloseCloseRealm     = "wamp.close.close_realm"
	CloseSystemShutdown = "wamp.close.system_shutdown"
	CloseKilled         = "wamp.close.killed"

	ErrNoMatchingAuthMethod       = "wamp.error.no_matching_auth_method"
	ErrNoSuchRealm                = "wamp.error.no_such_realm"
	ErrNoSuchRole                 = "wamp.error.no_such_role"
	ErrNoSuchPrincipal            = "wamp.error.no_such_principal"
	ErrNoSuchSession              = "wamp.error.no_such_session"
	ErrAuthenticationDenied       = "wamp.error.authentication_denied"
	ErrAuthenticationFailed       = "wamp.error.authentication_failed"
	ErrAuthenticationRequired     = "wamp.error.authentication_required"
	ErrAuthorizationDenied        = "wamp.error.authorization_denied"
	ErrAuthorizationFailed        = "wamp.error.authorization_failed"
	ErrAuthorizationRequired      = "wamp.error.authorization_required"
	ErrTimeout                    = "wamp.error.timeout"
	ErrOptionNotAllowed           = "wamp.error.option_not_allowed"
	ErrOptionDisallowedDiscloseMe = "wamp.error.option_disallowed.disclose_me"
	ErrNetworkFailure             = "wamp.error.network_failure"
	ErrUnavailable                = "wamp.error.unavailable"
	ErrNoAvailableCallee          = "wamp.error.no_available_callee"
	ErrFeatureNotSupported        = "wamp.error.feature_not_supported"
	ErrInvalidURI                 = "wamp.error.invalid_uri"
	ErrNoSuchProcedure            = "wamp.error.no_such_procedure"
	ErrProcedureAlreadyExists     = "wamp.error.procedure_already_exists"
	ErrNoSuchRegistration         = "wamp.error.no_such_registration"
	ErrNoSuchSubscription         = "wamp.error.no_such_subscription"
	ErrInvalidArgument            = "wamp.error.invalid_argument"
	ErrCanceled                   = "wamp.error.canceled"
	ErrPayloadSizeExceeded        = "wamp.error.payload_size_exceeded"
	ErrProtocolViolation          = "wamp.error.protocol_violation"
	ErrNotAuthorized              = "wamp.error.not_authorized"
)
View Source
const (
	OptAcknowledge = "acknowledge"
)

Variables

View Source
var ClientRoles = map[string]any{
	"caller": map[string]any{
		// contains filtered or unexported fields
	},
	"callee": map[string]any{
		// contains filtered or unexported fields
	},
	"publisher": map[string]any{
		// contains filtered or unexported fields
	},
	"subscriber": map[string]any{
		// contains filtered or unexported fields
	},
}
View Source
var RouterRoles = map[string]any{
	"dealer": map[string]any{
		// contains filtered or unexported fields
	},
	"broker": map[string]any{
		// contains filtered or unexported fields
	},
}

Functions

func GenerateID

func GenerateID() uint64

GenerateID generates a random WAMP ID.

Types

type Acceptor

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

func NewAcceptor

func NewAcceptor(serializer serializers.Serializer, authenticator auth.ServerAuthenticator) *Acceptor

func (*Acceptor) Receive

func (a *Acceptor) Receive(data []byte) (payload []byte, welcomed bool, err error)

func (*Acceptor) ReceiveMessage

func (a *Acceptor) ReceiveMessage(msg messages.Message) (messages.Message, error)

func (*Acceptor) SessionDetails

func (a *Acceptor) SessionDetails() (*SessionDetails, error)

type Broker

type Broker struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewBroker

func NewBroker() *Broker

func (*Broker) AddSession

func (b *Broker) AddSession(details *SessionDetails) error

func (*Broker) AutoDisclosePublisher

func (b *Broker) AutoDisclosePublisher(disclose bool)

func (*Broker) HasSubscription

func (b *Broker) HasSubscription(topic string) bool

func (*Broker) ReceiveMessage

func (b *Broker) ReceiveMessage(sessionID uint64, msg messages.Message) (*MessageWithRecipient, error)

func (*Broker) ReceivePublish

func (b *Broker) ReceivePublish(sessionID uint64, publish *messages.Publish) (*Publication, error)

func (*Broker) RemoveSession

func (b *Broker) RemoveSession(id uint64) error

type CallMap

type CallMap struct {
	CallerID uint64
	CallID   uint64
}

type Dealer

type Dealer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewDealer

func NewDealer() *Dealer

func (*Dealer) AddSession

func (d *Dealer) AddSession(details *SessionDetails) error

func (*Dealer) AutoDiscloseCaller

func (d *Dealer) AutoDiscloseCaller(disclose bool)

func (*Dealer) HasProcedure

func (d *Dealer) HasProcedure(procedure string) bool

func (*Dealer) ReceiveMessage

func (d *Dealer) ReceiveMessage(sessionID uint64, msg messages.Message) (*MessageWithRecipient, error)

func (*Dealer) RemoveSession

func (d *Dealer) RemoveSession(id uint64) error

type Joiner

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

func NewJoiner

func NewJoiner(realm string, serializer serializers.Serializer, authenticator auth.ClientAuthenticator) *Joiner

func (*Joiner) Receive

func (j *Joiner) Receive(data []byte) ([]byte, error)

func (*Joiner) ReceiveMessage

func (j *Joiner) ReceiveMessage(msg messages.Message) (messages.Message, error)

func (*Joiner) SendHello

func (j *Joiner) SendHello() ([]byte, error)

func (*Joiner) SessionDetails

func (j *Joiner) SessionDetails() (*SessionDetails, error)

type MessageWithRecipient

type MessageWithRecipient struct {
	Message   messages.Message
	Recipient uint64
}

type PendingInvocation

type PendingInvocation struct {
	RequestID       uint64
	CallerID        uint64
	CalleeID        uint64
	Progress        bool
	ReceiveProgress bool
}

type Publication

type Publication struct {
	Event      *messages.Event
	Recipients []uint64
	Ack        *MessageWithRecipient
}

type Registration

type Registration struct {
	ID               uint64
	Procedure        string
	Registrants      map[uint64]uint64
	InvocationPolicy string

	Match string
	// contains filtered or unexported fields
}

type Session

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

func NewSession

func NewSession(serializer serializers.Serializer) *Session

func (*Session) Receive

func (w *Session) Receive(data []byte) (messages.Message, error)

func (*Session) ReceiveMessage

func (w *Session) ReceiveMessage(msg messages.Message) (messages.Message, error)

func (*Session) SendMessage

func (w *Session) SendMessage(msg messages.Message) ([]byte, error)

type SessionDetails

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

func NewSessionDetails

func NewSessionDetails(id uint64, realm, authID, authRole, authMethod string, staticSerializer bool,
	routerRoles, authExtra map[string]any) *SessionDetails

func (*SessionDetails) AuthExtra

func (s *SessionDetails) AuthExtra() map[string]any

func (*SessionDetails) AuthID

func (s *SessionDetails) AuthID() string

func (*SessionDetails) AuthMethod

func (s *SessionDetails) AuthMethod() string

func (*SessionDetails) AuthRole

func (s *SessionDetails) AuthRole() string

func (*SessionDetails) CreatedAt

func (s *SessionDetails) CreatedAt() string

func (*SessionDetails) ID

func (s *SessionDetails) ID() uint64

func (*SessionDetails) Realm

func (s *SessionDetails) Realm() string

func (*SessionDetails) RouterRoles

func (s *SessionDetails) RouterRoles() map[string]any

func (*SessionDetails) StaticSerializer

func (s *SessionDetails) StaticSerializer() bool

type SessionScopeIDGenerator

type SessionScopeIDGenerator struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*SessionScopeIDGenerator) NextID

func (s *SessionScopeIDGenerator) NextID() uint64

type Subscription

type Subscription struct {
	ID          uint64
	Topic       string
	Subscribers map[uint64]uint64
	Match       string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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