platform

package
v0.0.0-...-45d8196 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2020 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DatastoreKV collection KV
	DatastoreKV string = "KV"
	// DefaultExpiration is the minimum time to keep an entry in the store
	DefaultExpiration int64 = 86400 * 14 // 14 days
)

Variables

This section is empty.

Functions

func Close

func Close()

Close the platform related clients

func Count

func Count(ctx context.Context, topic, label string, value int)

Count collects a numeric counter value

func Critical

func Critical(topic, format string, args ...interface{})

Critical is like Debug, but on CRITICAL level

func DataStore

func DataStore() *datastore.Client

DataStore returns a reference to the datastore

func Debug

func Debug(topic, format string, args ...interface{})

Debug formats its arguments according to the format, analogous to fmt.Printf, and records the text as a log message at Debug level.

func Get

func Get(ctx context.Context, k string) (string, error)

Get retrieves a value from the store or raises an exception if it does not exist

func Info

func Info(topic, format string, args ...interface{})

Info is like Debug, but on INFO level

func Invalidate

func Invalidate(ctx context.Context, k string)

Invalidate removes an entry from the cache

func PrintError

func PrintError(msg string, args ...interface{})

PrintError prints an error message to stderr

func Report

func Report(err error)

Report reports an error, what else?

func Set

func Set(ctx context.Context, k, v string, duration int64) error

Set adds an entry to the store. Existing values get updated

func Warn

func Warn(topic, format string, args ...interface{})

Warn is like Debug, but on WARN level

Types

type KV

type KV struct {
	Key     string
	Value   string
	Expires int64
}

KV is the datastructure to store stuff

Jump to

Keyboard shortcuts

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