sdk

package
v1.79.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2025 License: MIT Imports: 15 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(datasetAPIUrl string) *Client

New creates a new instance of Client for the service

func NewWithHealthClient

func NewWithHealthClient(hcCli *health.Client) *Client

NewWithHealthClient creates a new instance of service API Client, reusing the URL and Clienter from the provided healthcheck client

func (*Client) Checker

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

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

func (*Client) DoAuthenticatedGetRequest added in v1.75.0

func (c *Client) DoAuthenticatedGetRequest(ctx context.Context, headers Headers, uri *url.URL) (resp *http.Response, err error)

Creates new request object, executes a get request using the input `headers` and `uri` and returns the response

func (*Client) GetDataset added in v1.76.0

func (c *Client) GetDataset(ctx context.Context, headers Headers, collectionID, datasetID string) (dataset models.Dataset, err error)

Get returns dataset level information for a given dataset id

func (*Client) GetDatasetByPath added in v1.76.0

func (c *Client) GetDatasetByPath(ctx context.Context, headers Headers, path string) (dataset models.Dataset, err error)

GetDatasetByPath returns dataset level information for a given dataset path

func (*Client) GetEdition added in v1.76.0

func (c *Client) GetEdition(ctx context.Context, headers Headers, datasetID, editionID string) (edition models.Edition, err error)

GetEdition retrieves a single edition document from a given datasetID and edition label

func (*Client) GetEditions added in v1.76.0

func (c *Client) GetEditions(ctx context.Context, headers Headers, datasetID string, queryParams *QueryParams) (editionList EditionsList, err error)

GetEditions returns all editions for a dataset

func (*Client) GetVersion

func (c *Client) GetVersion(ctx context.Context, headers Headers, datasetID, editionID, versionID string) (version models.Version, err error)

GetVersion gets a specific version for an edition from the dataset api

func (*Client) GetVersionDimensionOptions added in v1.75.0

func (c *Client) GetVersionDimensionOptions(ctx context.Context, headers Headers, datasetID, editionID, versionID, dimensionID string, queryParams *QueryParams) (versionDimensionOptionsList VersionDimensionOptionsList, err error)

Returns the options for a dimension

func (*Client) GetVersionDimensions added in v1.75.0

func (c *Client) GetVersionDimensions(ctx context.Context, headers Headers, datasetID, editionID, versionID string) (versionDimensionsList VersionDimensionsList, err error)

GetVersionDimensions will return a list of dimensions for a given version of a dataset

func (*Client) GetVersionMetadata added in v1.75.0

func (c *Client) GetVersionMetadata(ctx context.Context, headers Headers, datasetID, editionID, versionID string) (metadata models.Metadata, err error)

GetVersionMetadata returns the metadata for a given dataset id, edition and version

func (*Client) GetVersions added in v1.75.0

func (c *Client) GetVersions(ctx context.Context, headers Headers, datasetID, editionID string, queryParams *QueryParams) (versionsList VersionsList, err error)

GetVersions gets all versions for an edition from the dataset api

func (*Client) Health

func (c *Client) Health() *health.Client

Health returns the underlying Healthcheck Client for this API client

func (*Client) URL

func (c *Client) URL() string

URL returns the URL used by this client

type EditionsList added in v1.76.0

type EditionsList struct {
	Items      []models.Edition `json:"items"`
	Count      int              `json:"count"`
	Offset     int              `json:"offset"`
	Limit      int              `json:"limit"`
	TotalCount int              `json:"total_count"`
}

EditionList represents an object containing a list of paginated versions. This struct is based on the `pagination.page` struct which is returned when we call the `api.getEditions` endpoint

type Headers added in v1.75.0

type Headers struct {
	CollectionID         string
	DownloadServiceToken string
	ServiceToken         string
	UserAccessToken      string
}

Contains the headers to be added to any request

func (*Headers) Add added in v1.75.0

func (h *Headers) Add(request *http.Request)

Adds headers to the input request

type QueryParams added in v1.75.0

type QueryParams struct {
	IDs       []string
	IsBasedOn string
	Limit     int
	Offset    int
}

QueryParams represents the possible query parameters that a caller can provide

func (*QueryParams) Validate added in v1.75.0

func (q *QueryParams) Validate() error

Validate validates tht no negative values are provided for limit or offset, and that the length of IDs is lower than the maximum

type VersionDimensionOptionsList added in v1.75.0

type VersionDimensionOptionsList struct {
	Items []models.PublicDimensionOption
}

VersionDimensionOptionsList represent a list of PublicDimensionOption

func (VersionDimensionOptionsList) ToString added in v1.79.0

func (m VersionDimensionOptionsList) ToString() string

type VersionDimensionsList added in v1.75.0

type VersionDimensionsList struct {
	Items []models.Dimension
}

VersionDimensionsList represent a list of Dimension

type VersionsList added in v1.75.0

type VersionsList struct {
	Items      []models.Version `json:"items"`
	Count      int              `json:"count"`
	Offset     int              `json:"offset"`
	Limit      int              `json:"limit"`
	TotalCount int              `json:"total_count"`
}

VersionsList represents an object containing a list of paginated versions. This struct is based on the `pagination.page` struct which is returned when we call the `api.getVersions` endpoint

Jump to

Keyboard shortcuts

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