httpd

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2022 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DayDuration = time.Hour * 24
)
View Source
const HTTPStatusEnhanceYourCalm = 420
View Source
const (
	ShutdownTimer = 5 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheResponse

type CacheResponse struct {
	Response []byte
	Time     time.Time
}

type HTTPAdminJWTToken

type HTTPAdminJWTToken struct {
	Token     string
	SessionID string
	Expires   time.Time
}

func (*HTTPAdminJWTToken) IsValid

func (h *HTTPAdminJWTToken) IsValid() bool

type HTTPAdminLogin

type HTTPAdminLogin struct {
	LoggedIn bool
	Username string
	Password string
	Version  string
	Expiry   time.Time

	HTTPError
}

type HTTPAdminPowerAction added in v1.1.0

type HTTPAdminPowerAction struct {
	Action string
	HTTPError
}

type HTTPAdminSession

type HTTPAdminSession struct {
	UUID      string
	Username  string
	LoginTime time.Time
}

func (*HTTPAdminSession) IsValid

func (h *HTTPAdminSession) IsValid() bool

type HTTPAdminSettings

type HTTPAdminSettings struct {
	*config.Configuration
	LogList map[service.ID]service.Info
	HTTPError
}

type HTTPAdminTokenData

type HTTPAdminTokenData struct {
	Access  *HTTPAdminJWTToken
	Refresh *HTTPAdminJWTToken
}

type HTTPCache

type HTTPCache map[HTTPCacheID]interface{}

type HTTPCacheID

type HTTPCacheID int

type HTTPError

type HTTPError struct {
	Error     string
	ErrorCode int
}

type MasterQuery

type MasterQuery struct {
	*query.MasterQuery
	ServerCount int
}

type MastersByPing

type MastersByPing []*MasterQuery

func (MastersByPing) Len

func (m MastersByPing) Len() int

func (MastersByPing) Less

func (m MastersByPing) Less(i, j int) bool

func (MastersByPing) Swap

func (m MastersByPing) Swap(i, j int)

type PingInfoQueryByPing

type PingInfoQueryByPing []*query.PingInfoQuery

func (PingInfoQueryByPing) Len

func (p PingInfoQueryByPing) Len() int

func (PingInfoQueryByPing) Less

func (p PingInfoQueryByPing) Less(i, j int) bool

func (PingInfoQueryByPing) Swap

func (p PingInfoQueryByPing) Swap(i, j int)

type RouteLogger

type RouteLogger struct {
	http.ResponseWriter
	Status int
}

func (*RouteLogger) WriteHeader

func (r *RouteLogger) WriteHeader(status int)

type Router

type Router struct {
	*log.Log
	// contains filtered or unexported fields
}

func NewHTTPRouter

func NewHTTPRouter(log *log.Log, buildinfo *service.BuildInfo, config *config.Service) (out *Router)

func (*Router) AddRoute

func (rt *Router) AddRoute(path string, method string, fn http.Handler)

func (*Router) InitTemplate

func (rt *Router) InitTemplate() (err error)

func (*Router) Mux

func (rt *Router) Mux() (out *http.ServeMux)

func (*Router) SetFileSystem

func (rt *Router) SetFileSystem(fs fs.FS, err error)

type ServerListData

type ServerListData struct {
	RequestTime time.Time
	Masters     MastersByPing
	Games       PingInfoQueryByPing
	Errors      []string
}

type Service

type Service struct {
	sync.Mutex

	service.Interface
	service.Runnable
	service.Maintainable
	// contains filtered or unexported fields
}

func (*Service) Init

func (s *Service) Init(services *map[service.ID]service.Interface) (err error)

func (*Service) Maintenance

func (s *Service) Maintenance()

func (*Service) Rehash

func (s *Service) Rehash()

func (*Service) Run

func (s *Service) Run()

func (*Service) Shutdown

func (s *Service) Shutdown()

func (*Service) Status added in v1.1.0

func (s *Service) Status() service.LifeCycle

Jump to

Keyboard shortcuts

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