Documentation ¶
Overview ¶
Package service implements the Archer service API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAmpliconCoverage ¶
func GetAmpliconCoverage(sampleStats *api.SampleStats) (int, int, float64)
GetAmpliconCoverage will check SampleStats and return the number of covered amplicons, the total number of amplicons and the mean coverage.
func NewArcher ¶
func NewArcher(options ...ArcherOption) (api.ArcherServer, func() error, error)
NewArcher creates the Archer server and returns it along with the shutdown method and any constructor error.
func NewSample ¶
func NewSample(options ...SampleOption) (*api.SampleInfo, error)
NewSample will return an initialised SampleInfo struct with default values.
Types ¶
type Archer ¶
Archer is an implementation of the v1.ArcherServer.
It includes some extra data and methods to provide extra functionality.
func (*Archer) Cancel ¶
func (a *Archer) Cancel(ctx context.Context, request *api.CancelRequest) (*api.CancelResponse, error)
Cancel is used to...
func (*Archer) Process ¶
func (a *Archer) Process(ctx context.Context, request *api.ProcessRequest) (*api.ProcessResponse, error)
Process will begin processing for a sample.
func (*Archer) Watch ¶
func (a *Archer) Watch(request *api.WatchRequest, stream api.Archer_WatchServer) error
Watch will respond to WatchRequests by streaming completed samples back to the user as they are marked done by Archer.
type ArcherOption ¶
ArcherOption is a wrapper struct used to pass functional options to the Archer constructor.
func SetBucket ¶
func SetBucket(name, region string) ArcherOption
SetBucket is an option setter for the NewArcher constructor that sets the S3 bucket field of the Archer struct.
func SetDb ¶
func SetDb(dbPath string) ArcherOption
SetDb is an option setter for the NewArcher constructor that opens a db at the specified path and sets the appropriate field of the Archer struct.
func SetManifest ¶
func SetManifest(manifestURL string) ArcherOption
SetManifest is an option setter for the NewArcher constructor that downloads and opens a manifest and sets the appropriate field of the Archer struct.
func SetNumWorkers ¶
func SetNumWorkers(numWorkers int) ArcherOption
SetNumWorkers is an option setter for the NewArcher constructor that sets the number of concurrent process request workers to use.
type SampleOption ¶
type SampleOption func(sample *api.SampleInfo) error
SampleOption is a wrapper struct used to pass functional options to the Sample constructor.
func SetID ¶
func SetID(id string) SampleOption
SetID is an option setter for the NewSample constructor that sets the ID field of a SampleInfo struct.
func SetRequest ¶
func SetRequest(request *api.ProcessRequest) SampleOption
SetRequest is an option setter for the NewSample constructor that sets the request field of a SampleInfo struct and populates some additional data.