auth

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(validator JWTValidator, pusher Pusher, connStore ConnectionStore) ws.RouteHandler

Types

type ConnectionStore

type ConnectionStore interface {
	SaveConnection(ctx context.Context, conn store.WebSocketConnection) error
}

type JWTValidator

type JWTValidator interface {
	ValidateToken(ctx context.Context, tokenString string) (*auth.SessionClaims, *auth.SensitiveClaims, error)
}

type Pusher

type Pusher interface {
	Push(ctx context.Context, connectionID string, actionType string, payload any) (bool, error)
	Disconnect(ctx context.Context, connectionID string)
}

type Request

type Request struct {
	Action string `json:"action"`
	Token  string `json:"token"`
}

type Response

type Response struct {
	Success      bool   `json:"success"`
	UserID       int64  `json:"userId,omitempty"`
	ConnectionID string `json:"connectionId,omitempty"`
	Error        string `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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