httpGo

package
v1.0.281 Latest Latest
Warning

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

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

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 added in v1.0.14

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 added in v1.0.19

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

func (*CfgHttp) Deny added in v1.0.19

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

func (*CfgHttp) IsAccess added in v1.0.19

func (cfg *CfgHttp) IsAccess() bool

func (*CfgHttp) Reload added in v1.0.19

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