server

package
v0.0.3-alpha3 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAlertmanagerClient

func NewAlertmanagerClient(amURL *url.URL) *client.Alertmanager

func SetLogger

func SetLogger(l *zap.SugaredLogger)

Types

type AlertDispatcher

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

func NewAlertDispatcher

func NewAlertDispatcher(amURL *url.URL, alertEvaluationInterval time.Duration) *AlertDispatcher

func (*AlertDispatcher) LoopSendAlerts

func (a *AlertDispatcher) LoopSendAlerts(ctx context.Context, es store.EventStore)

func (*AlertDispatcher) SendAlert

func (a *AlertDispatcher) SendAlert(event *tarianpb.Event) error

type ConfigServer

type ConfigServer struct {
	tarianpb.UnimplementedConfigServer
	// contains filtered or unexported fields
}

func NewConfigServer

func NewConfigServer(dsn string) (*ConfigServer, error)

func (*ConfigServer) AddConstraint

func (*ConfigServer) GetConstraints

func (*ConfigServer) RemoveConstraint

type EventServer

type EventServer struct {
	tarianpb.UnimplementedEventServer
	// contains filtered or unexported fields
}

func NewEventServer

func NewEventServer(dsn string) (*EventServer, error)

func (*EventServer) GetEvents

func (*EventServer) IngestEvent

type PostgresqlConfig

type PostgresqlConfig struct {
	User     string `default:"postgres"`
	Password string `default:"tarian"`
	DbName   string `default:"tarian"`
	Host     string `default:"localhost"`
	Port     string `default:"5432"`
	SslMode  string `default:"disable"`
}

func (*PostgresqlConfig) GetDsn

func (p *PostgresqlConfig) GetDsn() string

type Server

type Server struct {
	GrpcServer      *grpc.Server
	EventServer     *EventServer
	ConfigServer    *ConfigServer
	AlertDispatcher *AlertDispatcher
	// contains filtered or unexported fields
}

func NewServer

func NewServer(dsn string, certFile string, privateKeyFile string) (*Server, error)

func (*Server) Start

func (s *Server) Start(grpcListenAddress string) error

func (*Server) StartAlertDispatcher

func (s *Server) StartAlertDispatcher()

func (*Server) Stop

func (s *Server) Stop()

func (*Server) WithAlertDispatcher

func (s *Server) WithAlertDispatcher(alertManagerAddress *url.URL, alertEvaluationInterval time.Duration) *Server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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