filterflex

package
v2.153.0-beta.99 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthHeaders added in v2.153.0

type AuthHeaders struct {
	UserAuthToken    string
	ServiceAuthToken string
}

AuthHeaders represents the common set of headers required for making authorized requests

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 New

func New(cfg Config) *Client

New creates a new instance of Client with a given host api url

func NewWithHealthClient

func NewWithHealthClient(cfg Config, cli *health.Client) *Client

NewWithHealthClient creates a new instance of Client, reusing the URL and Clienter from the provided health check client.

func (*Client) Checker

func (c *Client) Checker(ctx context.Context, check *healthcheck.CheckState) error

Checker calls filter api health endpoint and returns a check object to the caller.

func (*Client) DeleteOption added in v2.153.0

func (c *Client) DeleteOption(ctx context.Context, input GetDeleteOptionInput) (eTag string, err error)

func (*Client) ForwardRequest

func (c *Client) ForwardRequest(req *http.Request) (*http.Response, error)

ForwardRequest is used for forwarding a request from another service. Initially implemented for fowarding requests for Cantabular based datasets from dp-filter-api. The provided request is expected have any required headers as the original request will have been made using the relevant api-client. Note that the caller is responsible for closing the response body as with making a regular http request.

type Config

type Config struct {
	HostURL string
}

Config holds config for initialising a client

type Error

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

Error is the package's error type

func (*Error) Error

func (e *Error) Error() string

Error implements the standard Go error

func (*Error) LogData

func (e *Error) LogData() map[string]interface{}

LogData implemented the DataLogger interface and allows log data to be embedded in and retrieved from an error

func (*Error) Unwrap

func (e *Error) Unwrap() error

Unwrap implements Go error unwrapping

type GetDeleteOptionInput added in v2.153.0

type GetDeleteOptionInput struct {
	FilterID  string
	Dimension string
	Option    string
	IfMatch   string
	AuthHeaders
}

getFilterInput holds the required fields for making the GET /filters API call

Jump to

Keyboard shortcuts

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