server

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RouteAPIRegister string = "/api/register"
	RouteAPISend     string = "/api/send"
	RouteAPIWS       string = "/api/stream"
	RouteAPIPosts    string = "/api"
	RouteIndex       string = "/"

	PostsPerPage int = 30

	FetchMaxErrors int = 3
)

Variables

This section is empty.

Functions

func IPAddress

func IPAddress() config.IPAddress

func Port

func Port() config.Port

func PublicPath added in v0.4.0

func PublicPath() string

func SetIPAddress

func SetIPAddress(newIP config.IPAddress)

func SetPort

func SetPort(newPort config.Port)

func SetPublicPath added in v0.4.0

func SetPublicPath(newPublicPath string)

Types

type Handler

type Handler struct{}

func NewHandler added in v0.4.0

func NewHandler() *Handler

type Option

type Option func(*Service) error

type PostUpdate added in v0.4.0

type PostUpdate struct {
	Posts    []models.PostDisplay
	TotalNum int
}

type Service

type Service struct {
	*http.Server
	Errors chan error
}

func New

func New() *Service

func (*Service) Shutdown

func (s *Service) Shutdown(ctx context.Context, wg *sync.WaitGroup) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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