healthcheck

package
v0.0.0-...-d93c677 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name              string
	URL               string
	DynamoDBTableName string
	FailureThreshold  int
	SuccessThreshold  int
	Timeout           time.Duration
	Interval          time.Duration
	SNSTopicARNs      []string
	TeamsWebhookURL   string
	LogFilename       string
	LogLevel          string
}

func (Config) Notify

func (c Config) Notify(result Result) error

func (Config) Run

func (c Config) Run() (result Result, err error)

type Result

type Result struct {
	Name                 string    `dynamodbav:"name"`
	URL                  string    `dynamodbav:"url"`
	Body                 string    `dynamodbav:"body"`
	Status               int       `dynamodbav:"status"`
	Description          string    `dynamodbav:"description"`
	ChangeDescription    string    `dynamodbav:"change_description"`
	LastNotificationTime time.Time `dynamodbav:"last_notification_time"`
	LastCheckTime        time.Time `dynamodbav:"last_check_time"`
	ResponseTime         string    `dynamodbav:"response_time"`
	LastSuccessTime      time.Time `dynamodbav:"last_successful_check_time"`
	LastFailureTime      time.Time `dynamodbav:"last_failure_time"`
	SuccessCount         int       `dynamodbav:"success_count"`
	FailureCount         int       `dynamodbav:"failure_count"`
}

type TableBasics

type TableBasics struct {
	DynamoDbClient *dynamodb.Client
	TableName      string
}

TableBasics encapsulates the Amazon DynamoDB service actions used in the examples. It contains a DynamoDB service client that is used to act on the specified table.

func (TableBasics) CreateTable

func (basics TableBasics) CreateTable() (*types.TableDescription, error)

func (TableBasics) GetItem

func (basics TableBasics) GetItem(url string) (*Result, error)

func (TableBasics) PutItem

func (basics TableBasics) PutItem(r Result) error

func (TableBasics) TableExists

func (basics TableBasics) TableExists() (bool, error)

TableExists determines whether a DynamoDB table exists.

Jump to

Keyboard shortcuts

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