repository

package
v0.0.0-...-4b3986e Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregatedError

type AggregatedError struct {
	gorm.Model
	ServiceName    string `gorm:"index"`
	AggregationKey string `gorm:"index"`
	Errors         ErrorAggregate
	TotalCount     int
}

type ErrorAggregate

type ErrorAggregate struct {
	AggregationKey string             `json:"aggregation_key"`
	TotalCount     int                `json:"total_count"`
	Severity       string             `json:"severity"`
	LatestErrors   []ErrorWithContext `json:"latest_errors"`
	CreatedAt      int64              `json:"created_at"`
}

func (*ErrorAggregate) Scan

func (e *ErrorAggregate) Scan(src interface{}) error

func (ErrorAggregate) Value

func (e ErrorAggregate) Value() (driver.Value, error)

type ErrorInstance

type ErrorInstance struct {
	Class      string         `json:"class"`
	Message    string         `json:"message"`
	Stacktrace []string       `json:"stacktrace"`
	Cause      *ErrorInstance `json:"cause"`
}

type ErrorWithContext

type ErrorWithContext struct {
	Error       ErrorInstance `json:"error"`
	UUID        string        `json:"uuid"`
	Timestamp   int64         `json:"timestamp"`
	Severity    string        `json:"severity"`
	HTTPContext *HTTPContext  `json:"http_context"`
}

type ErrorsRepository

type ErrorsRepository interface {
	GetErrors(serviceName string, numberOfErrors int) ([]ErrorAggregate, error)
	ReplaceErrors(serviceName string, errors []ErrorAggregate)
	GetServices() []string
	ResolveError(serviceName string, key string) error
	SearchResolved(serviceName string, key string) bool
	RemoveResolved(serviceName string, key string)
	TargetsRepository
}

func NewMemoryRepository

func NewMemoryRepository() ErrorsRepository

func NewORMRepository

func NewORMRepository(db *gorm.DB) ErrorsRepository

func NewRepository

func NewRepository(repositoryConfig config.Repository) ErrorsRepository

NewRepository is a factory function for ErrorRepository interfaces. It creates a repository based on the configured repository.

type HTTPContext

type HTTPContext struct {
	RequestMethod  string            `json:"request_method"`
	RequestURL     string            `json:"request_url"`
	RequestHeaders map[string]string `json:"request_headers"`
	RequestBody    string            `json:"request_body"`
}

type Target

type Target struct {
	Endpoint string `json:"endpoint"`
}

type TargetsRepository

type TargetsRepository interface {
	StoreTargets(serviceName string, targets []Target)
	GetTargets() map[string][]Target
}

Jump to

Keyboard shortcuts

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