server

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHuma

func NewHuma(params HumaParams) huma.API

func NewMux

func NewMux(params MuxParams) *chi.Mux

Types

type Addr added in v0.3.0

type Addr string

func ListenAddress added in v0.4.10

func ListenAddress(addr string) Addr

func ListenAddressFromEnv added in v0.4.10

func ListenAddressFromEnv(env string, defaultValue ...string) Addr

type HumaParams added in v0.3.0

type HumaParams struct {
	fx.In
	Manifest      *manifest.Manifest
	Mux           *chi.Mux
	AuthProviders *auth.Providers `optional:"true"`
}

type MuxParams added in v0.4.0

type MuxParams struct {
	fx.In
	UseCors UseCors `optional:"true"`
}

type Params added in v0.3.0

type Params struct {
	fx.In
	Addr      Addr `optional:"true"`
	Router    *Router
	ApiConfig *api.Config    `optional:"true"`
	Handlers  []*api.Handler `group:"api.handler"`
}

type Router

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

func NewRouter

func NewRouter(cfg RouterConfig) *Router

type RouterConfig

type RouterConfig struct {
	fx.In
	Mux            *chi.Mux
	Api            huma.API
	AuthMiddleware *auth.Middleware
}

type Server

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

func New

func New(params Params) *Server

func (*Server) OnStart

func (s *Server) OnStart(ctx context.Context) error

func (*Server) OnStop

func (s *Server) OnStop(ctx context.Context) error

type UseCors added in v0.4.0

type UseCors bool

Jump to

Keyboard shortcuts

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