status

package
v0.0.0-...-9ba5f82 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	Calculate(ctx context.Context, company string, eventEntries int, log *logrus.Entry) (*Response, error)
}

type EnvironmentStatus

type EnvironmentStatus struct {
	Object      string        `json:"object"`
	Company     string        `json:"company"`
	Team        string        `json:"team"`
	Environment string        `json:"environment"`
	Status      *ObjectStatus `json:"status"`
}

func NewEnvironmentStatus

func NewEnvironmentStatus(events []*event.Event, eventEntries int) (*EnvironmentStatus, error)

type EnvironmentStatusMap

type EnvironmentStatusMap map[string]map[string]*EnvironmentStatus

type GroupedEnvironmentEvents

type GroupedEnvironmentEvents map[string]map[string][]*event.Event

type GroupedEventsByFamily

type GroupedEventsByFamily map[event.Family][]*event.Event

type GroupedTeamEvents

type GroupedTeamEvents map[string][]*event.Event

type ObjectStatus

type ObjectStatus struct {
	Events []*event.Event           `json:"events"`
	Object string                   `json:"object"`
	Meta   any                      `json:"meta"`
	Status map[event.Family]*Status `json:"status"`
}

func NewObjectStatus

func NewObjectStatus(events []*event.Event, entries int) (*ObjectStatus, error)

type Response

type Response struct {
	TeamsStatus       TeamStatusMap        `json:"teamsStatus"`
	EnvironmentStatus EnvironmentStatusMap `json:"environmentStatus"`
}

type Service

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

func NewService

func NewService(es event.API, db *sqlx.DB) *Service

func (*Service) Calculate

func (s *Service) Calculate(ctx context.Context, company string, eventEntries int, log *logrus.Entry) (*Response, error)

type State

type State string
const (
	StateOK      State = "ok"
	StateUnknown State = "unknown"
	StateError   State = "error"
)

type Status

type Status struct {
	State     State        `json:"state"`
	Family    event.Family `json:"family"`
	Errors    []string     `json:"errors,omitempty"`
	Timestamp time.Time    `json:"timestamp"`
}

type TeamStatus

type TeamStatus struct {
	Object  string        `json:"object"`
	Company string        `json:"company"`
	Team    string        `json:"team"`
	Status  *ObjectStatus `json:"status"`
}

func NewTeamStatus

func NewTeamStatus(events []*event.Event, eventEntries int) (*TeamStatus, error)

type TeamStatusMap

type TeamStatusMap map[string]*TeamStatus

Jump to

Keyboard shortcuts

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