iotmaker_capibaribe_module

package module
v0.0.0-...-cb0d640 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2019 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Index

Examples

Constants

View Source
const (
	KIgnorePortRegExp                = "^(.*?):[0-9]+$"
	KLoadBalanceRoundRobin           = "roundRobin"
	KLoadBalanceRandom               = "random"
	KLoadBalanceExecutionTime        = "lowTimeResponse"
	KLoadBalanceExecutionTimeAverage = "lowTimeResponseAverage"

	KHeaderTypeString = "string"
	KHeaderTypeRegExp = "regExp"
)
View Source
const KListMaxLength = 50

Variables

This section is empty.

Functions

func ConfigCertificates

func ConfigCertificates(config ssl, server *http.Server)

func HandleCriticalError

func HandleCriticalError(err error)

func NewServerStruct

func NewServerStruct(host string, weight float64, overLoad int) servers

Types

type Analytics

type Analytics struct {
	NumberCurrentExecutions         int64
	ExecutionSuccessDurationMax     time.Duration
	ExecutionSuccessDurationMin     time.Duration
	ExecutionDurationEntireList     []executionInfo
	ExecutionDurationSuccessList    []executionInfo
	ExecutionDurationErrorList      []executionInfo
	ExecutionDurationSuccessAverage time.Duration
	ConsecutiveErrors               int
	ConsecutiveSuccess              int
	TotalErrorsCounter              int
	TotalSuccessCounter             int
	LastRoundError                  bool
	// contains filtered or unexported fields
}

bt_br: Struct com a funcionalidade de registrar contadores e temporizadores em eventos de fim de execução, tanto para eventos com sucesso ou erro. en: A Struct that has the functionality of register, counters and timers, in the event of the end of the run, for both events, with a success or an error.

func NewAnalytics

func NewAnalytics() Analytics

pt_br: Prepara o struct do tipo AnalyticsCheck para ser usado en: Mounts a struct type AnalyticsCheck for a correct use

func (*Analytics) GetLastRoundError

func (el *Analytics) GetLastRoundError() bool

func (*Analytics) OnExecutionEndWithError

func (el *Analytics) OnExecutionEndWithError()

bt_br: Esta função deve ser chamada ao final de uma execução com erro en: This function should be called at the end of the run with an error

func (*Analytics) OnExecutionEndWithSuccess

func (el *Analytics) OnExecutionEndWithSuccess()

pt_br: Esta função deve deve ser chamada ao final de uma execução com sucesso en: This function must be called at the end of a successful execution

func (*Analytics) OnExecutionStart

func (el *Analytics) OnExecutionStart()

bt_br: Esta função deve ser chamada antes do início do servidor correspondente a rota do proxy reverso en: This function must be called prior to the start of the server for correspondent route in the reverse proxy

Example
a := Analytics{}

// before execution start
fmt.Printf("NumberCurrentExecutions: %v\n", a.NumberCurrentExecutions)
fmt.Printf("timeOnStarEvent equals to 0: %v\n", a.timeOnStarEvent.UnixNano())
a.OnExecutionStart()

fmt.Printf("NumberCurrentExecutions: %v\n", a.NumberCurrentExecutions)
fmt.Printf("timeOnStarEvent greater than 0: %v\n", a.timeOnStarEvent.UnixNano() > 0)
Output:

NumberCurrentExecutions: 0
timeOnStarEvent equals to 0: -6795364578871345152
NumberCurrentExecutions: 1
timeOnStarEvent greater than 0: true

type DebugLogger

type DebugLogger struct{}

func (DebugLogger) Write

func (d DebugLogger) Write(p []byte) (n int, err error)

type Listen

type Listen struct {
	InProtocol  string      `yaml:"inProtocol"  json:"inProtocol"`
	InAddress   string      `yaml:"inAddress"   json:"inAddress"`
	OutProtocol string      `yaml:"outProtocol" json:"outProtocol"`
	OutAddress  string      `yaml:"outAddress"  json:"outAddress"`
	Pygocentrus pygocentrus `yaml:"pygocentrus" json:"pygocentrus"`
	// contains filtered or unexported fields
}

func (*Listen) Listen

func (el *Listen) Listen() error

type ListenAndServer

type ListenAndServer struct {
	// Example: 8081
	InAddress string `yaml:"inAddress" json:"inAddress"`
}

type MainConfig

type MainConfig struct {
	Version       float64            `yaml:"version"           json:"version"`
	AffluentRiver map[string]Project `yaml:"capibaribe"        json:"capibaribe"`
	// contains filtered or unexported fields
}

func (*MainConfig) LoadConfAndStart

func (el *MainConfig) LoadConfAndStart(filePath string)

func (*MainConfig) Unmarshal

func (el *MainConfig) Unmarshal(filePath string) error

func (*MainConfig) UnmarshalByte

func (el *MainConfig) UnmarshalByte(fileContent []byte) error

func (*MainConfig) Wait

func (el *MainConfig) Wait()

func (*MainConfig) WaitAddDelta

func (el *MainConfig) WaitAddDelta()

func (*MainConfig) WaitDone

func (el *MainConfig) WaitDone()

type Project

type Project struct {
	ListenAndServer   ListenAndServer `yaml:"listenAndServer"   json:"listenAndServer"`
	Sll               ssl             `yaml:"ssl"               json:"ssl"`
	Proxy             []proxy         `yaml:"proxy"             json:"proxy"`
	DebugServerEnable bool            `yaml:"debugServerEnable" json:"debugServerEnable"`
	HealthCheck       healthCheck     `yaml:"healthCheck"       json:"healthCheck"`
	AnalyticsCheck    analyticsCheck  `yaml:"analyticsCheck"    json:"analyticsCheck"`
	Listen            Listen          `yaml:"-"                 json:"-"`
	// contains filtered or unexported fields
}

func (*Project) HandleFunc

func (el *Project) HandleFunc(w http.ResponseWriter, r *http.Request)

func (*Project) WaitAddDelta

func (el *Project) WaitAddDelta()

func (*Project) WaitDone

func (el *Project) WaitDone()

type Transport

type Transport struct {
	http.RoundTripper
}

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error)

Jump to

Keyboard shortcuts

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