Documentation
¶
Index ¶
- Constants
- func Close()
- func Count(ctx context.Context, name, label string, value int) error
- func CreateSimpleTask(ctx context.Context, handler, payload string) (*taskspb.Task, error)
- func CreateTask(ctx context.Context, handler string, payload interface{}) (*taskspb.Task, error)
- func Critical(topic, format string, args ...interface{})
- func DataStore() *datastore.Client
- func Debug(topic, format string, args ...interface{})
- func GetJobTimestamp(ctx context.Context, name string) int64
- func GetKV(ctx context.Context, k string) (string, error)
- func Info(topic, format string, args ...interface{})
- func InvalidateKV(ctx context.Context, k string)
- func Log(args interface{}, labels map[string]string)
- func PrintError(msg string, args ...interface{})
- func ReportError(err error)
- func SetKV(ctx context.Context, k, v string, duration int64) error
- func Storage() *storage.Client
- func UpdateJob(ctx context.Context, name string, ts int64) error
- func Warn(topic, format string, args ...interface{})
- type Counter
- type Job
- type KV
- type Metric
Constants ¶
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 )
const ( // DatastoreMetrics collection of metrics DatastoreMetrics string = "METRICS" // CountType is a int counter CountType = "COUNTER" )
const ( // DatastoreJobs collection of job / cron metadata DatastoreJobs string = "JOBS" )
Variables ¶
This section is empty.
Functions ¶
func CreateSimpleTask ¶ added in v0.10.0
CreateSimpleTask is used to schedule a background task using the default queue. The payload is a simple string, i.e. no marshalling happens.
func CreateTask ¶ added in v0.10.0
CreateTask is used to schedule a background task using the default queue. The payload can be any struct and will be marshalled into a json string.
func Critical ¶
func Critical(topic, format string, args ...interface{})
Critical is like Debug, but on CRITICAL level
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 GetJobTimestamp ¶ added in v0.9.0
GetJobTimestamp returns the timestamp when a job was last executed
func GetKV ¶ added in v0.9.0
GetKV 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 InvalidateKV ¶ added in v0.9.0
InvalidateKV removes an entry from the cache
func PrintError ¶
func PrintError(msg string, args ...interface{})
PrintError prints an error message to stderr
func ReportError ¶ added in v0.9.0
func ReportError(err error)
ReportError reports an error, what else?