pgxalerts

package
v0.2024.5 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPageSize = 50
	MaxPageSize     = 1000
)

Variables

This section is empty.

Functions

func SetupDB

func SetupDB(ctx context.Context, pool *pgxpool.Pool) error

Types

type Execer

type Execer interface {
	Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error)
}

type PageToken

type PageToken struct {
	LastCreateTime time.Time `json:"ct"`
	LastID         string    `json:"id"`
}

func DecodePageToken

func DecodePageToken(s string) (PageToken, error)

func (PageToken) Encode

func (p PageToken) Encode() (text string, err error)

type QueryRower

type QueryRower interface {
	QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row
}

type Server

type Server struct {
	gen.UnimplementedAlertApiServer
	gen.UnimplementedAlertAdminApiServer

	// Floors, if set, is used to pre-populate AlertMetadata with zero values for cases when no alerts appear on a floor.
	Floors []string
	// Zones, if set, is used to pre-populate AlertMetadata with zero values for cases when no alerts appear in a zone.
	Zones []string
	// Severity, if set, is used to pre-populate AlertMetadata with zero values for cases when no alerts have a severity.
	Severity []gen.Alert_Severity
	// Subsystems, if set, is used to pre-populate AlertMetadata with zero values for cases when no alerts appear in a subsystem.
	Subsystems []string
	// contains filtered or unexported fields
}

func NewServer

func NewServer(ctx context.Context, connStr string) (*Server, error)

func NewServerFromPool

func NewServerFromPool(ctx context.Context, pool *pgxpool.Pool) (*Server, error)

func (*Server) AcknowledgeAlert

func (s *Server) AcknowledgeAlert(ctx context.Context, request *gen.AcknowledgeAlertRequest) (*gen.Alert, error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) CreateAlert

func (s *Server) CreateAlert(ctx context.Context, request *gen.CreateAlertRequest) (*gen.Alert, error)

func (*Server) DeleteAlert

func (s *Server) DeleteAlert(ctx context.Context, request *gen.DeleteAlertRequest) (*gen.DeleteAlertResponse, error)

func (*Server) GetAlertMetadata

func (s *Server) GetAlertMetadata(ctx context.Context, request *gen.GetAlertMetadataRequest) (*gen.AlertMetadata, error)

func (*Server) ListAlerts

func (s *Server) ListAlerts(ctx context.Context, request *gen.ListAlertsRequest) (*gen.ListAlertsResponse, error)

func (*Server) PullAlertMetadata

func (s *Server) PullAlertMetadata(request *gen.PullAlertMetadataRequest, server gen.AlertApi_PullAlertMetadataServer) error

func (*Server) PullAlerts

func (s *Server) PullAlerts(request *gen.PullAlertsRequest, server gen.AlertApi_PullAlertsServer) error

func (*Server) ResolveAlert

func (s *Server) ResolveAlert(ctx context.Context, request *gen.ResolveAlertRequest) (*gen.Alert, error)

func (*Server) UnacknowledgeAlert

func (s *Server) UnacknowledgeAlert(ctx context.Context, request *gen.AcknowledgeAlertRequest) (*gen.Alert, error)

func (*Server) UpdateAlert

func (s *Server) UpdateAlert(ctx context.Context, request *gen.UpdateAlertRequest) (*gen.Alert, error)

Jump to

Keyboard shortcuts

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