webserver

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultHttpListenAddr = "127.0.0.1:8080"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DevMode        bool
	TLS            bool
	ConfigDir      string
	HttpListenAddr string
}

func NewConfig added in v0.3.0

func NewConfig(configDir string) *Config

func (*Config) Verify added in v0.3.0

func (c *Config) Verify() error

type Webserver

func NewWebserver

func NewWebserver(config *Config, db *database.Database) (*Webserver, error)

func (*Webserver) ConfigureRoutes added in v0.3.0

func (s *Webserver) ConfigureRoutes(isDev bool)

func (*Webserver) Login added in v0.3.0

func (*Webserver) Logout added in v0.3.0

func (*Webserver) RefreshToken added in v0.3.0

func (s *Webserver) RefreshToken(user *models.User, w http.ResponseWriter, r *http.Request) http.HandlerFunc

func (*Webserver) Run added in v0.3.0

func (s *Webserver) Run(serviceWG *sync.WaitGroup)

Run is the main thread of the process, called as a goroutine.

func (*Webserver) Start

func (s *Webserver) Start(serviceWG *sync.WaitGroup) error

Start spawns all processes done by the service.

func (*Webserver) Stop

func (s *Webserver) Stop() error

Stop terminates all processes belonging to the service.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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