server

package
v1.9.16 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MPL-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenAndServeHTTP

func ListenAndServeHTTP(handler http.Handler, logger *slog.Logger, listen string)

ListenAndServeHTTP starts a HTTP server. Actually, can be extended to support HTTPS.

func MakeVGSocketRealmAPIHandler

func MakeVGSocketRealmAPIHandler(api *operations.VGSocketRealmAPI, pcors bool) http.Handler

MakeVGSocketRealmAPIHandler - finally create a HTTP handler for the API.

func NewAPI

func NewAPI() *operations.VGSocketRealmAPI

NewAPI - init API.

func NewLogger

func NewLogger(logger *slog.Logger, r *http.Request, principal *models.Principal) *slog.Logger

NewLogger - logger for API and Core. It is used by endpoint handlers for metadata access.

func SetBrigadeHandlers added in v1.9.11

func SetBrigadeHandlers(ctx context.Context, opts *APIOpts)

func SetSecurityHandlers

func SetSecurityHandlers(ctx context.Context, opts *APIOpts, jwtMethod jwt.SigningMethod, jwtVerifier interface{})

SetSecurityHandlers - set handlers for security.

func SetUserHandlers

func SetUserHandlers(ctx context.Context, opts *APIOpts)

Types

type APIOpts

type APIOpts struct {
	Logger *slog.Logger

	API *operations.VGSocketRealmAPI

	Db    *pgxpool.Pool
	SqFmt sq.StatementBuilderType

	AccessKey string

	Testing   bool
	KdTesting bool
}

Jump to

Keyboard shortcuts

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