recipe

package
v2.203.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: MIT Imports: 11 Imported by: 8

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
}

Client is a recpie api client which can be used to make requests to the server

func NewClient

func NewClient(recipeAPIURL string) *Client

NewClient creates a new instance of Client with a given recipe api url

func NewWithHealthClient

func NewWithHealthClient(hcCli *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 recipe api health endpoint and returns a check object to the caller.

func (*Client) GetRecipe

func (c *Client) GetRecipe(ctx context.Context, userAuthToken, serviceAuthToken, recipeID string) (*Recipe, error)

GetRecipe from an ID

type CodeList

type CodeList struct {
	ID                           string `json:"id,omitempty"`
	HRef                         string `json:"href,omitempty"`
	Name                         string `json:"name,omitempty"`
	IsHierarchy                  *bool  `json:"is_hierarchy,omitempty"`
	IsCantabularGeography        *bool  `json:"is_cantabular_geography,omitempty"`
	IsCantabularDefaultGeography *bool  `json:"is_cantabular_default_geography,omitempty"`
}

CodeList holds one of the codelists corresponding to a recipe

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
}

ErrorResponse models the error response from cantabular

type Instance

type Instance struct {
	DatasetID       string     `json:"dataset_id,omitempty"`
	Editions        []string   `json:"editions,omitempty"`
	Title           string     `json:"title,omitempty"`
	CodeLists       []CodeList `json:"code_lists,omitempty"`
	LowestGeography string     `json:"lowest_geography,omitempty"`
}

Instance holds one of the output_instances corresponding to a recipe

type Recipe

type Recipe struct {
	ID              string     `json:"id,omitempty"`
	Alias           string     `json:"alias,omitempty"`
	Format          string     `json:"format,omitempty"`
	InputFiles      []file     `json:"files,omitempty"`
	OutputInstances []Instance `json:"output_instances,omitempty"`
	CantabularBlob  string     `json:"cantabular_blob,omitempty"`
	PopulationType  string     `json:"population_type,omitempty"`
}

Recipe holds the response body for GET /recipes/{id}

Jump to

Keyboard shortcuts

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