server

package
v0.0.0-...-d57bbc6 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Listen = func(srv *http.Server, cert, key string) (err error) {
	return srv.ListenAndServeTLS(cert, key)
}

Listen function that runs sever, could be overloaded by testing needs.

Functions

func Default

func Default() http.HandlerFunc

func Mast

func Mast() http.HandlerFunc

Mast is like a telegraph mast that receives messages from telegram and responds back.

func Reload

func Reload() http.HandlerFunc

Types

type Command

type Command struct {
	common.Auth `group:"auth" description:"authentication related options"`

	Port    int    `short:"p" long:"port" default:"8443" env:"DNQ_SERVER_PORT" description:"server port"`
	Address string `short:"H" long:"host" default:"0.0.0.0" env:"DNQ_SERVER_HOST" description:"server address"`

	Config flags.Filename `short:"c" long:"config" env:"DNQ_CONFIG" default:"config.yaml" description:"configuration file"`

	// TSL options
	Cert string `long:"cert" env:"DNQ_SERVER_CERT" default:"resources/server.pem" description:"server.{pem,crt} file"`
	Key  string `long:"key" env:"DNQ_SERVER_KEY" default:"resources/server.key" description:"server.key file"`
	// contains filtered or unexported fields
}

Command +

func (*Command) Execute

func (command *Command) Execute(_ []string) (err error)

Execute +

Jump to

Keyboard shortcuts

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