server

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: MIT Imports: 13 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

type HumaParams added in v0.3.0

type HumaParams struct {
	fx.In
	Manifest      *manifest.Manifest
	Mux           *chi.Mux
	AuthProviders *auth.Providers
}

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 `optional:"true"`
}

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