dimension

package
v2.121.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: MIT Imports: 13 Imported by: 2

Documentation

Overview

Package dimension provides an HTTP client for the Cantabular Dimension API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AreaType

type AreaType struct {
	ID         string `json:"id"`
	Label      string `json:"label"`
	TotalCount int    `json:"total_count"`
}

AreaType is an area-type model with ID and Label

type Client

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

Client is a Cantabular Dimension API client

func NewClient

func NewClient(dimensionsAPIURL string) (*Client, error)

NewClient creates a new instance of Client with a given Dimensions API URL

func NewWithHealthClient

func NewWithHealthClient(hcCli *health.Client) (*Client, error)

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 recipe api health endpoint and returns a check object to the caller

func (*Client) GetAreaTypes

func (c *Client) GetAreaTypes(ctx context.Context, userAuthToken, serviceAuthToken, datasetID string) (GetAreaTypesResponse, error)

GetAreaTypes retrieves the Cantabular area-types associated with a dataset

type ErrorResp

type ErrorResp struct {
	Errors []string `json:"errors"`
}

ErrorResp represents an error response containing a list of errors

func (ErrorResp) Error

func (e ErrorResp) Error() string

type GetAreaTypesResponse

type GetAreaTypesResponse struct {
	AreaTypes []AreaType `json:"area-types"`
}

GetAreaTypesResponse is the response object for GET /area-types

Jump to

Keyboard shortcuts

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