cronscript

package
v0.0.0-...-8540621 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Datastore

type Datastore struct {
	// contains filtered or unexported fields
}

Datastore implements the CronScriptStore interface on a given Datastore.

func NewDatastore

NewDatastore wraps the datastore in a cronScriptStore.

func (*Datastore) DeleteCronScript

func (t *Datastore) DeleteCronScript(id uuid.UUID) error

DeleteCronScript deletes a cron script from the store by ID.

func (*Datastore) GetAllCronScriptResults

func (t *Datastore) GetAllCronScriptResults() ([]*storepb.CronScriptResult, error)

GetAllCronScriptResults returns all of the stored execution results for all scripts.

func (*Datastore) GetCronScriptResults

func (t *Datastore) GetCronScriptResults(id uuid.UUID) ([]*storepb.CronScriptResult, error)

GetCronScriptResults returns the results of past runs of a specific CronScript.

func (*Datastore) GetCronScripts

func (t *Datastore) GetCronScripts() ([]*cvmsgspb.CronScript, error)

GetCronScripts fetches all scripts in the cron script store.

func (*Datastore) RecordCronScriptResult

func (t *Datastore) RecordCronScriptResult(result *storepb.CronScriptResult) error

RecordCronScriptResult saves the data for the latest result. If it exceeds the maximum number for that result, the call will delete the oldest entry.

func (*Datastore) SetCronScripts

func (t *Datastore) SetCronScripts(scripts []*cvmsgspb.CronScript) error

SetCronScripts sets the list of all cron scripts to match the given set of scripts.

func (*Datastore) UpsertCronScript

func (t *Datastore) UpsertCronScript(script *cvmsgspb.CronScript) error

UpsertCronScript updates or adds a cron script to the store, based on ID.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is an implementation of the cronscriptstore service.

func New

func New(ds Store) *Server

New creates a new server.

func (*Server) AddOrUpdateScript

AddOrUpdateScript updates or adds a cron script to the store, based on ID.

func (*Server) DeleteScript

DeleteScript deletes a cron script from the store by ID.

func (*Server) GetAllExecutionResults

GetAllExecutionResults returns all of the execution results for cronscripts stored by this service.

func (*Server) GetScripts

GetScripts fetches all scripts in the cron script store.

func (*Server) RecordExecutionResult

RecordExecutionResult records the stats of a successful CronScript execution or the error message of an unsuccessful execution.

func (*Server) SetScripts

SetScripts sets the list of all cron scripts to match the given set of scripts.

func (*Server) Stop

func (s *Server) Stop()

Stop performs any necessary cleanup before shutdown.

type Store

type Store interface {
	GetCronScripts() ([]*cvmsgspb.CronScript, error)
	UpsertCronScript(script *cvmsgspb.CronScript) error
	DeleteCronScript(id uuid.UUID) error
	SetCronScripts(scripts []*cvmsgspb.CronScript) error
	RecordCronScriptResult(*storepb.CronScriptResult) error
	GetAllCronScriptResults() ([]*storepb.CronScriptResult, error)
}

Store is a datastore which can store, update, and retrieve information about cron scripts.

Directories

Path Synopsis
Package mock_cronscript is a generated GoMock package.
Package mock_cronscript is a generated GoMock package.

Jump to

Keyboard shortcuts

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