server

package
v0.0.0-...-79e42f8 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnection

func NewConnection(app *gsockets.App, conn *websocket.Conn, cm gsockets.ChannelManager, logger log.Logger) gsockets.Connection

func RenderJSON

func RenderJSON(w http.ResponseWriter, statusCode int, message string, data any)

Types

type AuthMiddleware

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

func NewAuthMiddleware

func NewAuthMiddleware(apps gsockets.AppManager) *AuthMiddleware

func (*AuthMiddleware) Handler

func (auth *AuthMiddleware) Handler(next http.Handler) http.Handler

Handler verifies the existence of the app and the signature for the request. See https://pusher.com/docs/channels/library_auth_reference/rest-api#Authentication for implementation details.

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
	Code  int    `json:"code"`
}

type Response

type Response struct {
	Message string `json:"message,omitempty"`
}

type Server

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

Server struct is the gsockets server.

func New

func New(config config.Config, logger log.Logger) *Server

func (*Server) Id

func (srv *Server) Id() string

func (*Server) Start

func (srv *Server) Start() error

func (*Server) Stop

func (srv *Server) Stop()

Jump to

Keyboard shortcuts

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