Documentation ¶
Index ¶
- func CloseResponseBody(ctx context.Context, resp *http.Response)
- type Client
- func (c *Client) AddDimension(ctx context.Context, ...) error
- func (c *Client) AddDimensionValue(ctx context.Context, ...) error
- func (c *Client) AddDimensionValues(ctx context.Context, ...) error
- func (c *Client) Checker(ctx context.Context, check *health.CheckState) error
- func (c *Client) CreateBlueprint(ctx context.Context, ...) (string, error)
- func (c *Client) GetDimension(ctx context.Context, ...) (dim Dimension, err error)
- func (c *Client) GetDimensionBytes(ctx context.Context, ...) ([]byte, error)
- func (c *Client) GetDimensionOptions(ctx context.Context, ...) (opts []DimensionOption, err error)
- func (c *Client) GetDimensionOptionsBytes(ctx context.Context, ...) ([]byte, error)
- func (c *Client) GetDimensions(ctx context.Context, ...) (dims []Dimension, err error)
- func (c *Client) GetDimensionsBytes(ctx context.Context, ...) ([]byte, error)
- func (c *Client) GetJobState(ctx context.Context, ...) (m Model, err error)
- func (c *Client) GetJobStateBytes(ctx context.Context, ...) ([]byte, error)
- func (c *Client) GetOutput(ctx context.Context, ...) (m Model, err error)
- func (c *Client) GetOutputBytes(ctx context.Context, ...) ([]byte, error)
- func (c *Client) GetPreview(ctx context.Context, ...) (p Preview, err error)
- func (c *Client) GetPreviewBytes(ctx context.Context, ...) ([]byte, error)
- func (c *Client) RemoveDimension(ctx context.Context, ...) error
- func (c *Client) RemoveDimensionValue(ctx context.Context, ...) error
- func (c *Client) UpdateBlueprint(ctx context.Context, ...) (Model, error)
- func (c *Client) UpdateFilterOutput(ctx context.Context, ...) error
- func (c *Client) UpdateFilterOutputBytes(ctx context.Context, ...) error
- type Config
- type CreateBlueprint
- type Dataset
- type Dimension
- type DimensionOption
- type Download
- type ErrInvalidFilterAPIResponse
- type Event
- type Link
- type Links
- type Model
- type ModelDimension
- type Preview
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a filter api client which can be used to make requests to the server
func NewWithHealthClient ¶ added in v1.24.0
func NewWithHealthClient(hcCli *healthcheck.Client) *Client
NewWithHealthClient creates a new instance of Client, reusing the URL and Clienter from the provided health check client.
func (*Client) AddDimension ¶
func (c *Client) AddDimension(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, id, name string) error
AddDimension adds a new dimension to a filter job
func (*Client) AddDimensionValue ¶
func (c *Client) AddDimensionValue(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, filterID, name, value string) error
AddDimensionValue adds a particular value to a filter job for a given filterID and name
func (*Client) AddDimensionValues ¶
func (c *Client) AddDimensionValues(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, filterID, name string, options []string) error
AddDimensionValues adds many options to a filter job dimension
func (*Client) Checker ¶
Checker calls filter api health endpoint and returns a check object to the caller.
func (*Client) CreateBlueprint ¶
func (c *Client) CreateBlueprint(ctx context.Context, userAuthToken, serviceAuthToken, downloadServiceToken, collectionID, datasetID, edition, version string, names []string) (string, error)
CreateBlueprint creates a filter blueprint and returns the associated filterID
func (*Client) GetDimension ¶
func (c *Client) GetDimension(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, filterID, name string) (dim Dimension, err error)
GetDimension returns information on a requested dimension name for a given filterID unmarshalled as a Dimension struct
func (*Client) GetDimensionBytes ¶ added in v1.5.0
func (c *Client) GetDimensionBytes(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, filterID, name string) ([]byte, error)
GetDimensionBytes returns information on a requested dimension name for a given filterID as a byte array
func (*Client) GetDimensionOptions ¶
func (c *Client) GetDimensionOptions(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, filterID, name string) (opts []DimensionOption, err error)
GetDimensionOptions retrieves a list of the dimension options unmarshalled as an array of DimensionOption structs
func (*Client) GetDimensionOptionsBytes ¶ added in v1.5.0
func (c *Client) GetDimensionOptionsBytes(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, filterID, name string) ([]byte, error)
GetDimensionOptionsBytes retrieves a list of the dimension options as a byte array
func (*Client) GetDimensions ¶
func (c *Client) GetDimensions(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, filterID string) (dims []Dimension, err error)
GetDimensions will return the dimensions associated with the provided filter id as an array of Dimension structs
func (*Client) GetDimensionsBytes ¶ added in v1.5.0
func (c *Client) GetDimensionsBytes(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, filterID string) ([]byte, error)
GetDimensionsBytes will return the dimensions associated with the provided filter id as a byte array
func (*Client) GetJobState ¶
func (c *Client) GetJobState(ctx context.Context, userAuthToken, serviceAuthToken, downloadServiceToken, collectionID, filterID string) (m Model, err error)
GetJobState will return the current state of the filter job unmarshalled as a Model struct
func (*Client) GetJobStateBytes ¶ added in v1.5.0
func (c *Client) GetJobStateBytes(ctx context.Context, userAuthToken, serviceAuthToken, downloadServiceToken, collectionID, filterID string) ([]byte, error)
GetJobStateBytes will return the current state of the filter job as a byte array
func (*Client) GetOutput ¶
func (c *Client) GetOutput(ctx context.Context, userAuthToken, serviceAuthToken, downloadServiceToken, collectionID, filterOutputID string) (m Model, err error)
GetOutput returns a filter output job for a given filter output id, unmarshalled as a Model struct
func (*Client) GetOutputBytes ¶ added in v1.5.0
func (c *Client) GetOutputBytes(ctx context.Context, userAuthToken, serviceAuthToken, downloadServiceToken, collectionID, filterOutputID string) ([]byte, error)
GetOutputBytes returns a filter output job for a given filter output id as a byte array
func (*Client) GetPreview ¶
func (c *Client) GetPreview(ctx context.Context, userAuthToken, serviceAuthToken, downloadServiceToken, collectionID, filterOutputID string) (p Preview, err error)
GetPreview attempts to retrieve a preview for a given filterOutputID unmarshalled as a Preview struct
func (*Client) GetPreviewBytes ¶ added in v1.5.0
func (c *Client) GetPreviewBytes(ctx context.Context, userAuthToken, serviceAuthToken, downloadServiceToken, collectionID, filterOutputID string) ([]byte, error)
GetPreviewBytes attempts to retrieve a preview for a given filterOutputID as a byte array
func (*Client) RemoveDimension ¶
func (c *Client) RemoveDimension(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, filterID, name string) error
RemoveDimension removes a given dimension from a filter job
func (*Client) RemoveDimensionValue ¶
func (c *Client) RemoveDimensionValue(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, filterID, name, value string) error
RemoveDimensionValue removes a particular value to a filter job for a given filterID and name
func (*Client) UpdateBlueprint ¶
func (c *Client) UpdateBlueprint(ctx context.Context, userAuthToken, serviceAuthToken, downloadServiceToken, collectionID string, m Model, doSubmit bool) (Model, error)
UpdateBlueprint will update a blueprint with a given filter model
func (*Client) UpdateFilterOutput ¶ added in v1.5.0
func (c *Client) UpdateFilterOutput(ctx context.Context, userAuthToken, serviceAuthToken, downloadServiceToken, filterJobID string, model *Model) error
UpdateFilterOutput performs a PUT operation to update the filter with the provided filterOutput model
func (*Client) UpdateFilterOutputBytes ¶ added in v1.5.0
func (c *Client) UpdateFilterOutputBytes(ctx context.Context, userAuthToken, serviceAuthToken, downloadServiceToken, filterJobID string, b []byte) error
UpdateFilterOutputBytes performs a PUT operation to update the filter with the provided byte array
type CreateBlueprint ¶
type CreateBlueprint struct { Dataset Dataset `json:"dataset"` Dimensions []ModelDimension `json:"dimensions"` FilterID string `json:"filter_id"` }
CreateBlueprint represents the fields required to create a filter blueprint
type Dataset ¶
type Dataset struct { DatasetID string `json:"id"` Edition string `json:"edition"` Version int `json:"version"` }
Dataset represents the dataset fields required to create a filter blueprint
type DimensionOption ¶
type DimensionOption struct { DimensionOptionsURL string `json:"dimension_option_url"` Option string `json:"option"` }
DimensionOption represents a dimension option from the filter api
type Download ¶
type Download struct { URL string `json:"href"` Size string `json:"size"` Public string `json:"public,omitempty"` Private string `json:"private,omitempty"` Skipped bool `json:"skipped,omitempty"` }
Download represents a download within a filter from api response
type ErrInvalidFilterAPIResponse ¶
ErrInvalidFilterAPIResponse is returned when the filter api does not respond with a valid status
func (ErrInvalidFilterAPIResponse) Code ¶
func (e ErrInvalidFilterAPIResponse) Code() int
Code returns the status code received from filter api if an error is returned
func (ErrInvalidFilterAPIResponse) Error ¶
func (e ErrInvalidFilterAPIResponse) Error() string
Error should be called by the user to print out the stringified version of the error
type Links ¶
type Links struct { Version Link `json:"version,omitempty"` FilterOutputs Link `json:"filter_output,omitempty"` FilterBlueprint Link `json:"filter_blueprint,omitempty"` }
Links represents a links object on the filter api response
type Model ¶
type Model struct { FilterID string `json:"filter_id"` InstanceID string `json:"instance_id"` Links Links `json:"links"` DatasetID string `json:"dataset_id"` Edition string `json:"edition"` Version string `json:"version"` State string `json:"state"` Dimensions []ModelDimension `json:"dimensions,omitempty"` Downloads map[string]Download `json:"downloads,omitempty"` Events []Event `json:"events,omitempty"` IsPublished bool `json:"published"` }
Model represents a model returned from the filter api
type ModelDimension ¶
type ModelDimension struct { Name string `json:"name"` Options []string `json:"options"` Values []string `json:"values"` }
ModelDimension represents a dimension to be filtered upon