http

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPort = 2333
	MinimalPort = 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host        string                 `yaml:"host" json:"host"`
	Port        int                    `yaml:"port" json:"port"`
	Enabled     bool                   `yaml:"enabled" json:"enabled"`
	EnablePProf bool                   `yaml:"enablePprof" json:"enablePprof"`
	XXX         map[string]interface{} `yaml:",inline"`
}

func NewConfig

func NewConfig() Config

func (*Config) Apply

func (c *Config) Apply() error

func (*Config) UnmarshalYAML

func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

func (*Config) Validate

func (c *Config) Validate() error

type Server

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

func NewServer

func NewServer(config Config, write *service.WriteService, read *service.ReadService) *Server

func (*Server) Mux

func (s *Server) Mux() *http.ServeMux

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop()

Stop tries to shutdown the HTTP server gracefully TODO: it seems after pprof is enabled, it can't stop gracefully https://gist.github.com/peterhellberg/38117e546c217960747aacf689af3dc2

Jump to

Keyboard shortcuts

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