server

package
v0.0.0-...-6794387 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthStatus

type HealthStatus struct {
	RedisStatus   bool `json:"redis_status"`
	MongoDBStatus bool `json:"mongo_db_status"`
}

type Server

type Server struct {
	Broker *broker.Broker

	// configuration from .env
	Config cmd.Config

	// handler for errors processing
	ErrorsHandler errorshandler.Handler

	// handler for release processing
	ReleaseHandler        releasehandler.Handler
	RedisClient           *redis.RedisClient
	AccountsMongoDBClient *accounts.AccountsMongoDBClient

	BlacklistThreshold int
	NotifyURL          string
}

Server represents fasthttp server

func New

func New(configuration cmd.Config, brokerClient *broker.Broker, redisClient *redis.RedisClient, accountsMongoDBClient *accounts.AccountsMongoDBClient, threshold int, notifyURL string) *Server

New creates new server and initiates it with link to the broker and copy of configuration parameters

func (*Server) HandleHealth

func (s *Server) HandleHealth(ctx *fasthttp.RequestCtx)

HandleHealth handles health statuses of redis, rabbitmq and mongodb

func (*Server) Run

func (s *Server) Run()

Run server

func (*Server) UpdateBlacklist

func (s *Server) UpdateBlacklist() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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