server

package
v0.0.0-...-0cf1795 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(config *ServerConfig) error

func TokenBasedLoginUrl

func TokenBasedLoginUrl(lc LoginConfig, userID uint, expiresIn time.Duration) (*url.URL, error)

Types

type LoginConfig

type LoginConfig struct {
	Key          []byte
	ValidMethods []string
	BaseUrl      url.URL
}

type RouterConfig

type RouterConfig struct {
	DbDebug                 bool
	Webauthn                webauthn.Config
	Limit                   RouterLimitConfig
	SessionKey              []byte
	UserRegistrationEnabled bool
	Login                   LoginConfig
	Auth                    auth.Config
}

type RouterLimitConfig

type RouterLimitConfig struct {
	RequestLimit int
	WindowLength time.Duration
}

type ServeType

type ServeType int8
const (
	ServeTypeHttp ServeType = iota
	ServeTypeFcgi
)

type ServerConfig

type ServerConfig struct {
	Router    RouterConfig
	ServeType ServeType
	HttpPort  string
}

Jump to

Keyboard shortcuts

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