s3

package
v1.0.1-0...-fe66d50 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const Type = "s3"

Type should match the package name

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	AccessKeyID     string `json:"access_key_id"`
	SecretAccessKey string `json:"secret_access_key"`
	Region          string `json:"region,omitempty"`
	Bucket          string `json:"bucket"`

	// Check files older than CheckExpiry will be
	// deleted on calls to Maintain(). If this is
	// the zero value, no old check files will be
	// deleted.
	CheckExpiry time.Duration `json:"check_expiry,omitempty"`
}

Storage is a way to store checkup results in an S3 bucket.

func New

func New(config json.RawMessage) (Storage, error)

New creates a new Storage instance based on json config

func (Storage) Maintain

func (s Storage) Maintain() error

Maintain deletes check files that are older than s.CheckExpiry.

func (Storage) Provision

func (s Storage) Provision() (types.ProvisionInfo, error)

Provision creates a new IAM user in the account specified by s, and configures a bucket according to the values in s. The credentials in s must have the IAMFullAccess and AmazonS3FullAccess permissions in order to succeed.

The name of the created IAM user is "checkup-monitor-s3-public". It will have read-only permission to S3.

Provision need only be called once per status page (bucket), not once per endpoint.

func (Storage) Store

func (s Storage) Store(results []types.Result) error

Store stores results on S3 according to the configuration in s.

func (Storage) Type

func (Storage) Type() string

Type returns the storage driver package name

Jump to

Keyboard shortcuts

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