api

package
v0.0.0-...-1ec896d Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

type Endpoint struct {
	Mount          func(router chi.Router)
	UI             bool
	AllowAnonymous bool
}

func EndpointOf

func EndpointOf(mount func(router chi.Router), opts ...EndpointOption) Endpoint

type EndpointOption

type EndpointOption func(*Endpoint)

func AllowAnonymous

func AllowAnonymous() EndpointOption

func UI

func UI() EndpointOption

type Server

type Server struct {
	Store        ports.SessionStore
	HTTPCfg      config.HTTP
	SessionCfg   config.SessionTokens
	LoggingCfg   *config.Logging
	Router       *chi.Mux
	ApiEndpoints []Endpoint
	UiEndpoints  []Endpoint
	// contains filtered or unexported fields
}

func NewServer

func NewServer(
	httpCfg config.HTTP,
	loggingCfg *config.Logging,
	sessionCfg config.SessionTokens,
	store ports.SessionStore,
) *Server

func (*Server) AddEndpoints

func (s *Server) AddEndpoints(ep ...Endpoint)

func (*Server) Serve

func (s *Server) Serve() error

func (*Server) Shutdown

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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