webserver

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addr     string `yaml:"addr"`     // webhook server port
	CertFile string `yaml:"certFile"` // path to the x509 certificate for https
	KeyFile  string `yaml:"keyFile"`  // path to the x509 private key matching `CertFile`
}

WebServer config

func ReadConfigFile

func ReadConfigFile(configFile string) (*Config, error)

type WebServer

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

func Server

func Server() *WebServer

func (*WebServer) AddRoute

func (s *WebServer) AddRoute(method string, route string, handler func(http.ResponseWriter, *http.Request))

func (*WebServer) Config

func (s *WebServer) Config(cfg *Config)

func (*WebServer) Start

func (s *WebServer) Start()

func (*WebServer) Stop

func (s *WebServer) Stop() error

Jump to

Keyboard shortcuts

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