httpGo

package
v1.0.23 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2020 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CfgParamCoreAPI     = "CoreAPI"
	CfgParamCoreXPXNode = "XPXNode"
	CfgParamNetworkType = "networkType"
)

congig params in restMux

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessConf

type AccessConf struct {
	ChkConn    bool     `yaml:"ChkConn"`
	AllowIP    []string `yaml:"Allow"`
	DenyIP     []string `yaml:"Deny"`
	Mess       string   `yaml:"Mess"`
	AllowRoute []string `yaml:"AllowRoute"`
	DenyRoute  []string `yaml:"DenyRoute"`
}

type CfgHttp

type CfgHttp struct {

	// list tokens to check requests
	KillSignal int              `yaml:"KillSignal"`
	Server     *fasthttp.Server `yaml:"Server"`
	Access     AccessConf       `yaml:"Access"`
	// contains filtered or unexported fields
}

CfgHttp has some options for Acceptor work

func NewCfgHttp

func NewCfgHttp(filename string) (cfgGlobal *CfgHttp, err error)

NewCfgHttp create CfgHttp from config file

func (*CfgHttp) Allow

func (cfg *CfgHttp) Allow(ctx *fasthttp.RequestCtx, addr string) bool

func (*CfgHttp) Deny

func (cfg *CfgHttp) Deny(ctx *fasthttp.RequestCtx, addr string) bool

func (*CfgHttp) IsAccess

func (cfg *CfgHttp) IsAccess() bool

func (*CfgHttp) Reload

func (cfg *CfgHttp) Reload() (interface{}, error)

type HttpGo

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

HttpGo implement rest api http/https server for operation with storage

func NewHttpgo

func NewHttpgo(cfg *CfgHttp, listener net.Listener, apis *Apis) *HttpGo

NewHttpgo get configuration option from cfg listener to receive requests

func (*HttpGo) Run

func (a *HttpGo) Run(secure bool, certFile, keyFile string) error

Run starting http or https server according to secure certFile and keyFile are paths to TLS certificate and key files for https server

Jump to

Keyboard shortcuts

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