backend

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppliedTrialSampleFilter added in v0.3.0

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

AppliedTrialSampleFilter represents a TrialSampleFilter applied to a particular trial

func NewAppliedTrialSampleFilter added in v0.3.0

func NewAppliedTrialSampleFilter(filter TrialSampleFilter, trialParams *grpcapi.TrialParams) *AppliedTrialSampleFilter

func (*AppliedTrialSampleFilter) Filter added in v0.3.0

func (*AppliedTrialSampleFilter) SelectsAll added in v0.3.0

func (f *AppliedTrialSampleFilter) SelectsAll() bool

type Backend

type Backend interface {
	Destroy()

	CreateOrUpdateTrials(ctx context.Context, trialsParams []*TrialParams) error
	RetrieveTrials(ctx context.Context, filter []string, fromTrialIdx int, count int) (TrialsInfoResult, error)
	ObserveTrials(ctx context.Context, filter []string, fromTrialIdx int, count int, out chan<- TrialsInfoResult) error
	DeleteTrials(ctx context.Context, trialIDs []string) error

	GetTrialParams(ctx context.Context, trialIDs []string) ([]*TrialParams, error)

	AddSamples(ctx context.Context, samples []*grpcapi.StoredTrialSample) error
	ObserveSamples(ctx context.Context, filter TrialSampleFilter, out chan<- *grpcapi.StoredTrialSample) error
}

Backend defines the interface for a datalogger backend

type TrialInfo

type TrialInfo struct {
	TrialID            string
	UserID             string
	State              grpcapi.TrialState
	SamplesCount       int
	StoredSamplesCount int
}

TrialInfo represents the storage status of the samples in a trial.

type TrialParams

type TrialParams struct {
	TrialID string
	UserID  string
	Params  *grpcapi.TrialParams
}

TrialParams represents the params of a trials

type TrialSampleFilter

type TrialSampleFilter struct {
	TrialIDs             []string
	ActorNames           []string
	ActorClasses         []string
	ActorImplementations []string
	Fields               []grpcapi.StoredTrialSampleField
}

TrialSampleFilter represents the arguments to filter requested trial samples

type TrialSampleObserver

type TrialSampleObserver chan *grpcapi.StoredTrialSample

type TrialsInfoObserver

type TrialsInfoObserver chan TrialsInfoResult

type TrialsInfoResult

type TrialsInfoResult struct {
	TrialInfos   []*TrialInfo
	NextTrialIdx int
}

type UnexpectedError added in v0.3.0

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

UnexpectedError is raised when an internal issue occurs

func NewUnexpectedError added in v0.3.0

func NewUnexpectedError(format string, a ...interface{}) *UnexpectedError

func (*UnexpectedError) Error added in v0.3.0

func (e *UnexpectedError) Error() string

func (*UnexpectedError) Unwrap added in v0.3.0

func (e *UnexpectedError) Unwrap() error

type UnknownTrialError

type UnknownTrialError struct {
	TrialID string
}

UnknownTrialError is raised when trying to operate on an unknown trial

func (*UnknownTrialError) Error

func (e *UnknownTrialError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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