filter

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFilterAPIError = errors.New("Internal error from the filter api")

ErrFilterAPIError returned when an unrecognised error occurs.

View Source
var ErrFilterJobNotFound = errors.New("failed to find filter job")

ErrFilterJobNotFound returned when the filter job count not be found for the given ID.

View Source
var ErrUnrecognisedAPIError = errors.New("Unrecognised error from the filter api")

ErrUnrecognisedAPIError returned when an unrecognised error occurs.

Functions

This section is empty.

Types

type Client

type Client interface {
	UpdateFilterOutputBytes(ctx context.Context, userAuthToken, serviceAuthToken, downloadServiceToken, filterJobID string, b []byte) error
	GetOutputBytes(ctx context.Context, userAuthToken, serviceAuthToken, downloadServiceToken, collectionID, filterOutputID string) ([]byte, error)
}

Client interface contains the method signatures expected to be implemented by dp-api-clients-go/filter

type Event

type Event struct {
	Type string    `bson:"type,omitempty" json:"type"`
	Time time.Time `bson:"time,omitempty" json:"time"`
}

Event represents a structure with type and time

type Store

type Store struct {
	Client
	// contains filtered or unexported fields
}

Store provides access to stored dimension data using the filter dp-api-client

func NewStore

func NewStore(cli Client, serviceAuthToken string) *Store

NewStore returns a new instance of a filter store.

func (*Store) GetFilter

func (store *Store) GetFilter(ctx context.Context, filterOutputID string) (filter *filter.Model, err error)

GetFilter returns filter data from the filter API for the given ID

func (*Store) PutCSVData

func (store *Store) PutCSVData(ctx context.Context, filterJobID string, csv filter.Download) error

PutCSVData allows the filtered file data to be sent back to the filter store when complete.

func (*Store) PutStateAsEmpty

func (store *Store) PutStateAsEmpty(ctx context.Context, filterJobID string) error

PutStateAsEmpty sets the filter output as empty

func (*Store) PutStateAsError

func (store *Store) PutStateAsError(ctx context.Context, filterJobID string) error

PutStateAsError set the filter output as an error, we shouldn't state the type of error as this will be displayed to the public

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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