cache

package
v0.38.69 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const AllStatuses = -1

Variables

View Source
var CacheChain = &cacheChain{
	Chain: []Cache{
		InMemoryCache,
	},
}
View Source
var InMemoryCache = &inMemoryCache{
	Checks:   make(map[string]*pkg.Check),
	Statuses: make(map[string][]pkg.CheckStatus),
}
View Source
var InMemoryCacheSize int
View Source
var PostgresCache = &postgresCache{
	Conn: nil,
}
View Source
var PostgresCacheTimeout int
View Source
var PostgresConnectionString string

Functions

func InitPostgres added in v0.38.58

func InitPostgres(connectionString string) (*pgxpool.Pool, error)

func QueryChecks added in v0.38.58

func QueryChecks(cache Cache, count int64, duration *time.Duration, checkKey string) pkg.Checks

Types

type Cache

type Cache interface {
	Add(check pkg.Check, status pkg.CheckStatus)
	GetChecks() pkg.Checks
	GetCheckFromKey(key string) *pkg.Check
	GetDetails(checkkey string, time string) interface{}
	ListCheckStatus(checkKey string, count int64, duration *time.Duration) []pkg.CheckStatus
	RemoveChecks(canary v1.Canary)
	RemoveCheckByKey(key string)
}

Jump to

Keyboard shortcuts

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