qmanager

package
v0.2.14 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Attempts int = iota
	Retry
)

Variables

View Source
var (
	Counter int
	//Divisor int
	CoordiQrnd uint64
	DBName     string

	ConfigValidatorsParsed bool
)
View Source
var IsInUse = false

Functions

func BootNodeSendData

func BootNodeSendData(w http.ResponseWriter, req *http.Request)

func CheckConfiValidators

func CheckConfiValidators()

func CheckQRNGStatus

func CheckQRNGStatus()

func CloseDB

func CloseDB()

func ConnectDB

func ConnectDB()

func CoordinatorConfirmation

func CoordinatorConfirmation(w http.ResponseWriter, req *http.Request)

func FindNode

func FindNode(dbStruct global.QManDBStruct) (found bool)

func GetAttemptsFromContext

func GetAttemptsFromContext(r *http.Request) int

GetAttemptsFromContext returns the attempts for request

func GetDBData

func GetDBData()

func GetRetryFromContext

func GetRetryFromContext(r *http.Request) int

GetAttemptsFromContext returns the attempts for request

func GovernanceAddValidators added in v0.2.0

func GovernanceAddValidators(w http.ResponseWriter, req *http.Request)

func GovernanceGetValidatorList added in v0.2.0

func GovernanceGetValidatorList(w http.ResponseWriter, req *http.Request)

func GovernanceRemoveValidators added in v0.2.0

func GovernanceRemoveValidators(w http.ResponseWriter, req *http.Request)

func GovernanceSendList

func GovernanceSendList(w http.ResponseWriter, req *http.Request)

func InitialValidatorConfigParsing

func InitialValidatorConfigParsing()

func InitializeQManager

func InitializeQManager()

func PeriodicValidatorConfigParsing

func PeriodicValidatorConfigParsing()

func Ping

func Ping(w http.ResponseWriter, req *http.Request)

func Save

func Save(dbStruct global.QManDBStruct) (saved bool)

func SaveToDB

func SaveToDB(Address []byte, NodeDetails []byte) (saved bool)

func Start

func Start(Addr *string, qmanKey *ecdsa.PrivateKey)

func StartExpirationChecker

func StartExpirationChecker()

func StartQRNGRefresher

func StartQRNGRefresher()

func UpdateSenatorCandidateNodes

func UpdateSenatorCandidateNodes()

Types

type Backend

type Backend struct {
	URL   *url.URL
	Alive bool

	ReverseProxy *httputil.ReverseProxy
	// contains filtered or unexported fields
}

Backend holds the data about a server

func (*Backend) IsAlive

func (b *Backend) IsAlive() (alive bool)

IsAlive returns true when backend is alive

func (*Backend) SetAlive

func (b *Backend) SetAlive(alive bool)

SetAlive for this backend

type ServerPool

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

ServerPool holds information about reachable backends

func (*ServerPool) AddBackend

func (s *ServerPool) AddBackend(backend *Backend)

AddBackend to the server pool

func (*ServerPool) GetNextPeer

func (s *ServerPool) GetNextPeer() *Backend

GetNextPeer returns next active peer to take a connection

func (*ServerPool) HealthCheck

func (s *ServerPool) HealthCheck()

HealthCheck pings the backends and update the status

func (*ServerPool) MarkBackendStatus

func (s *ServerPool) MarkBackendStatus(backendUrl *url.URL, alive bool)

MarkBackendStatus changes a status of a backend

func (*ServerPool) NextIndex

func (s *ServerPool) NextIndex() int

NextIndex atomically increase the counter and return an index

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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