server

package
v0.0.0-...-f3973e5 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAddress

func GetAddress() string

func GetDatabaseFile

func GetDatabaseFile() string

func GetPort

func GetPort() string

func GetSessionKey

func GetSessionKey() []byte

Types

type Server

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

func NewServer

func NewServer(ctx context.Context, options ...ServerOption) *Server

func (*Server) AddPublic

func (s *Server) AddPublic(assets fs.FS)

func (*Server) AddRoutes

func (s *Server) AddRoutes(routes routes.Routes)

func (*Server) Start

func (s *Server) Start(bindAddr string)

Start the server and should be called in with go routine

go s.Start("127.0.0.1:8080")

func (*Server) WaitAndTerminate

func (s *Server) WaitAndTerminate() error

WaitAndTerminate will wait until a termination signal is received and then shutdown the server.

type ServerOption

type ServerOption func(*Server)

func WithLogger

func WithLogger() ServerOption

func WithRecover

func WithRecover() ServerOption

func WithRemoveTrailingSlash

func WithRemoveTrailingSlash() ServerOption

func WithSecure

func WithSecure() ServerOption

func WithSession

func WithSession() ServerOption

Jump to

Keyboard shortcuts

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