checks

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DateLayout = time.RFC3339Nano

Variables

View Source
var (
	AbsoluteURLRegex = regexp.MustCompile("(?i)https?://.*")
)

Functions

func LoggingContextForCheck added in v1.0.4

func LoggingContextForCheck(checkType string, uuid string, environment string, transactionID string) string

func ScheduleChecks added in v1.0.4

func ScheduleChecks(
	p *SchedulerParam,
	endpointSpecificChecks map[string]EndpointSpecificCheck,
	appConfig *config.AppConfig,
	metricSink chan metrics.PublishMetric,
	e2eTestUUIDs []string,
	log *logger.UPPLogger,
)

Types

type ContentCheck added in v1.0.4

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

ContentCheck implements the EndpointSpecificCheck interface to check operation status for the content endpoint.

func NewContentCheck added in v1.0.4

func NewContentCheck(httpCaller httpcaller.Caller) ContentCheck

type ContentNeo4jCheck added in v1.0.4

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

ContentNeo4jCheck implements the EndpointSpecificCheck interface to check operation status for the content endpoint.

func NewContentNeo4jCheck added in v1.0.4

func NewContentNeo4jCheck(httpCaller httpcaller.Caller) ContentNeo4jCheck

type EndpointSpecificCheck added in v1.0.4

type EndpointSpecificCheck interface {
	// contains filtered or unexported methods
}

EndpointSpecificCheck is the interface which determines the state of the operation we are currently checking.

type NotificationsCheck added in v1.0.4

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

NotificationsCheck implements the EndpointSpecificCheck interface to build the endpoint URL and to check the operation is present in the notification feed

func NewNotificationsCheck added in v1.0.4

func NewNotificationsCheck(httpCaller httpcaller.Caller, subscribedFeeds map[string][]feeds.Feed, feedName string) NotificationsCheck

type PreCheck added in v1.8.0

type PreCheck func(
	publishedContent content.Content,
	tid string,
	publishDate time.Time,
	appConfig *config.AppConfig,
	metricContainer *metrics.History,
	environments *envs.Environments,
	log *logger.UPPLogger,
) (bool, *SchedulerParam)

func MainPreChecks added in v1.8.0

func MainPreChecks() []PreCheck

type PublishCheck added in v1.0.4

type PublishCheck struct {
	Metric metrics.PublishMetric

	Threshold     int
	CheckInterval int
	ResultSink    chan metrics.PublishMetric
	// contains filtered or unexported fields
}

PublishCheck performs an availability check on a piece of content, at a given endpoint, and returns whether the check was successful or not. Holds all the information necessary to check content availability at an endpoint, as well as store and send the results of the check.

func NewPublishCheck added in v1.0.4

func NewPublishCheck(
	metric metrics.PublishMetric,
	username, password string,
	threshold, checkInterval int,
	resultSink chan metrics.PublishMetric,
	endpointSpecificChecks map[string]EndpointSpecificCheck,
	log *logger.UPPLogger,
) *PublishCheck

NewPublishCheck returns a PublishCheck ready to perform a check for pm.UUID, at the pm.Endpoint.

func (PublishCheck) DoCheck added in v1.0.4

func (pc PublishCheck) DoCheck() (checkSuccessful, ignoreCheck bool)

DoCheck performs an availability check on a piece of content at a certain endpoint, applying endpoint-specific processing. Returns true if the content is available at the endpoint, false otherwise.

func (PublishCheck) String added in v1.0.4

func (pc PublishCheck) String() string

type SchedulerParam added in v1.0.4

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

Jump to

Keyboard shortcuts

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