population

package
v2.142.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: MIT Imports: 14 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Area

type Area struct {
	ID       string `json:"id"`
	Label    string `json:"label"`
	AreaType string `json:"area-type"`
}

Area is an area model with ID and Label

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 Population Types API client

func NewClient

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

NewClient creates a new instance of Client with a given Population Type 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) GetPopulationAreaTypes

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

GetPopulationAreaTypes retrieves the Cantabular area-types associated with a dataset

func (*Client) GetPopulationTypes

func (c *Client) GetPopulationTypes(ctx context.Context, input GetAreasInput) (GetAreasResponse, error)

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

type GetAreasInput

type GetAreasInput struct {
	UserAuthToken    string
	ServiceAuthToken string
	DatasetID        string
	AreaTypeID       string
	Text             string
}

type GetAreasResponse

type GetAreasResponse struct {
	Areas []Area `json:"areas"`
}

GetAreasResponse is the response object for GET /areas

Jump to

Keyboard shortcuts

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