Documentation
¶
Index ¶
- type IdentifiableController
- func (c *IdentifiableController) Authenticate(sid string, env *common.SessionEnv) (*common.ConnectResult, error)
- func (c *IdentifiableController) Disconnect(sid string, env *common.SessionEnv, id string, subscriptions []string) error
- func (c *IdentifiableController) Perform(sid string, env *common.SessionEnv, id string, channel string, data string) (*common.CommandResult, error)
- func (c *IdentifiableController) Shutdown() error
- func (c *IdentifiableController) Start() error
- func (c *IdentifiableController) Subscribe(sid string, env *common.SessionEnv, id string, channel string) (*common.CommandResult, error)
- func (c *IdentifiableController) Unsubscribe(sid string, env *common.SessionEnv, id string, channel string) (*common.CommandResult, error)
- type Identifier
- type IdentifierPipeline
- type JWTConfig
- type JWTIdentifier
- type PublicIdentifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IdentifiableController ¶
type IdentifiableController struct {
// contains filtered or unexported fields
}
func NewIdentifiableController ¶
func NewIdentifiableController(c node.Controller, i Identifier) *IdentifiableController
func (*IdentifiableController) Authenticate ¶
func (c *IdentifiableController) Authenticate(sid string, env *common.SessionEnv) (*common.ConnectResult, error)
func (*IdentifiableController) Disconnect ¶
func (c *IdentifiableController) Disconnect(sid string, env *common.SessionEnv, id string, subscriptions []string) error
func (*IdentifiableController) Perform ¶
func (c *IdentifiableController) Perform(sid string, env *common.SessionEnv, id string, channel string, data string) (*common.CommandResult, error)
func (*IdentifiableController) Shutdown ¶
func (c *IdentifiableController) Shutdown() error
func (*IdentifiableController) Start ¶
func (c *IdentifiableController) Start() error
func (*IdentifiableController) Subscribe ¶
func (c *IdentifiableController) Subscribe(sid string, env *common.SessionEnv, id string, channel string) (*common.CommandResult, error)
func (*IdentifiableController) Unsubscribe ¶
func (c *IdentifiableController) Unsubscribe(sid string, env *common.SessionEnv, id string, channel string) (*common.CommandResult, error)
type Identifier ¶
type Identifier interface {
Identify(sid string, env *common.SessionEnv) (*common.ConnectResult, error)
}
type IdentifierPipeline ¶ added in v1.5.0
type IdentifierPipeline struct {
// contains filtered or unexported fields
}
func NewIdentifierPipeline ¶ added in v1.5.0
func NewIdentifierPipeline(identifiers ...Identifier) *IdentifierPipeline
func (*IdentifierPipeline) Identify ¶ added in v1.5.0
func (p *IdentifierPipeline) Identify(sid string, env *common.SessionEnv) (*common.ConnectResult, error)
type JWTConfig ¶
type JWTConfig struct { Secret string `toml:"secret"` Param string `toml:"param"` Algo jwt.SigningMethod Force bool `toml:"force"` }
func NewJWTConfig ¶
type JWTIdentifier ¶
type JWTIdentifier struct {
// contains filtered or unexported fields
}
func NewJWTIdentifier ¶
func NewJWTIdentifier(config *JWTConfig, l *slog.Logger) *JWTIdentifier
func (*JWTIdentifier) Identify ¶
func (i *JWTIdentifier) Identify(sid string, env *common.SessionEnv) (*common.ConnectResult, error)
type PublicIdentifier ¶ added in v1.5.0
type PublicIdentifier struct { }
PublicIdentifier identifies all clients and use their sid as the only identifier
func NewPublicIdentifier ¶ added in v1.5.0
func NewPublicIdentifier() *PublicIdentifier
func (*PublicIdentifier) Identify ¶ added in v1.5.0
func (pi *PublicIdentifier) Identify(sid string, env *common.SessionEnv) (*common.ConnectResult, error)
Click to show internal directories.
Click to hide internal directories.