Documentation ¶
Index ¶
- Variables
- type Client
- type Event
- type FilterOutput
- type Store
- func (store *Store) GetFilter(ctx context.Context, filterOutputID string) (filter *observation.Filter, err error)
- func (store *Store) PutCSVData(ctx context.Context, filterJobID string, csv observation.DownloadItem) error
- func (store *Store) PutStateAsEmpty(ctx context.Context, filterJobID string) error
- func (store *Store) PutStateAsError(ctx context.Context, filterJobID string) error
Constants ¶
This section is empty.
Variables ¶
var ErrFilterAPIError = errors.New("Internal error from the filter api")
ErrFilterAPIError returned when an unrecognised error occurs.
var ErrFilterJobNotFound = errors.New("failed to find filter job")
ErrFilterJobNotFound returned when the filter job count not be found for the given ID.
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 FilterOutput ¶
type FilterOutput struct { FilterID string `json:"filter_id,omitempty"` InstanceID string `json:"instance_id"` State string `json:"state,omitempty"` Downloads *observation.Downloads `json:"downloads,omitempty"` Events []*Event `json:"events,omitempty"` Published bool `json:"published,omitempty"` }
FilterOutput represents a structure used to update the filter api
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 (*Store) GetFilter ¶
func (store *Store) GetFilter(ctx context.Context, filterOutputID string) (filter *observation.Filter, 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 observation.DownloadItem) error
PutCSVData allows the filtered file data to be sent back to the filter store when complete.
func (*Store) PutStateAsEmpty ¶
PutStateAsEmpty sets the filter output as empty