Documentation ¶
Index ¶
- type Datastore
- func (t *Datastore) DeleteCronScript(id uuid.UUID) error
- func (t *Datastore) GetAllCronScriptResults() ([]*storepb.CronScriptResult, error)
- func (t *Datastore) GetCronScriptResults(id uuid.UUID) ([]*storepb.CronScriptResult, error)
- func (t *Datastore) GetCronScripts() ([]*cvmsgspb.CronScript, error)
- func (t *Datastore) RecordCronScriptResult(result *storepb.CronScriptResult) error
- func (t *Datastore) SetCronScripts(scripts []*cvmsgspb.CronScript) error
- func (t *Datastore) UpsertCronScript(script *cvmsgspb.CronScript) error
- type Server
- func (s *Server) AddOrUpdateScript(ctx context.Context, req *metadatapb.AddOrUpdateScriptRequest) (*metadatapb.AddOrUpdateScriptResponse, error)
- func (s *Server) DeleteScript(ctx context.Context, req *metadatapb.DeleteScriptRequest) (*metadatapb.DeleteScriptResponse, error)
- func (s *Server) GetAllExecutionResults(ctx context.Context, req *metadatapb.GetAllExecutionResultsRequest) (*metadatapb.GetAllExecutionResultsResponse, error)
- func (s *Server) GetScripts(ctx context.Context, req *metadatapb.GetScriptsRequest) (*metadatapb.GetScriptsResponse, error)
- func (s *Server) RecordExecutionResult(ctx context.Context, req *metadatapb.RecordExecutionResultRequest) (*metadatapb.RecordExecutionResultResponse, error)
- func (s *Server) SetScripts(ctx context.Context, req *metadatapb.SetScriptsRequest) (*metadatapb.SetScriptsResponse, error)
- func (s *Server) Stop()
- type Store
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 ¶
func NewDatastore(ds datastore.MultiGetterSetterDeleterCloser) *Datastore
NewDatastore wraps the datastore in a cronScriptStore.
func (*Datastore) DeleteCronScript ¶
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 ¶
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 (*Server) AddOrUpdateScript ¶
func (s *Server) AddOrUpdateScript(ctx context.Context, req *metadatapb.AddOrUpdateScriptRequest) (*metadatapb.AddOrUpdateScriptResponse, error)
AddOrUpdateScript updates or adds a cron script to the store, based on ID.
func (*Server) DeleteScript ¶
func (s *Server) DeleteScript(ctx context.Context, req *metadatapb.DeleteScriptRequest) (*metadatapb.DeleteScriptResponse, error)
DeleteScript deletes a cron script from the store by ID.
func (*Server) GetAllExecutionResults ¶
func (s *Server) GetAllExecutionResults(ctx context.Context, req *metadatapb.GetAllExecutionResultsRequest) (*metadatapb.GetAllExecutionResultsResponse, error)
GetAllExecutionResults returns all of the execution results for cronscripts stored by this service.
func (*Server) GetScripts ¶
func (s *Server) GetScripts(ctx context.Context, req *metadatapb.GetScriptsRequest) (*metadatapb.GetScriptsResponse, error)
GetScripts fetches all scripts in the cron script store.
func (*Server) RecordExecutionResult ¶
func (s *Server) RecordExecutionResult(ctx context.Context, req *metadatapb.RecordExecutionResultRequest) (*metadatapb.RecordExecutionResultResponse, error)
RecordExecutionResult records the stats of a successful CronScript execution or the error message of an unsuccessful execution.
func (*Server) SetScripts ¶
func (s *Server) SetScripts(ctx context.Context, req *metadatapb.SetScriptsRequest) (*metadatapb.SetScriptsResponse, error)
SetScripts sets the list of all cron scripts to match the given set of scripts.
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.