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 the client for interacting with the Cantabular API
func (*Client) Checker ¶
func (c *Client) Checker(ctx context.Context, state *healthcheck.CheckState) error
Checker is a placeholder for Cantabular healthcheck, it returns StatusOK with a 'not implemented' message TODO implement this function when we decide how to check the health status of a cantabular service
func (*Client) GetCodebook ¶
func (c *Client) GetCodebook(ctx context.Context, req GetCodebookRequest) (*GetCodebookResponse, error)
GetCodebook gets a Codebook from cantabular.
type Codebook ¶
type Codebook []Variable
Variable represents a 'codebook' object returned from Cantabular
type Config ¶
type Config struct {
Host string
}
Config holds the config used to initialise the Cantabular Client
type Dataset ¶
type Dataset struct {
Name string `json:"name"`
Digest string `json:"digest"`
Description string `json:"description"`
Size int `json:"size"`
RulebaseVariable string `json:"ruleBaseVariable"`
DateTime time.Time `json:"datetime"`
}
Dataset represents a 'dataset' object returned from Cantabular
type ErrorResponse ¶
type ErrorResponse struct {
Message string `json:"message"`
}
ErrorResponse models the error response from cantabular
type GetCodebookRequest ¶
GetCodebookRequest holds the query parameters for GET /codebook/{dataset}?cats=xxx&v=xxx
type GetCodebookResponse ¶
type GetCodebookResponse struct {
Codebook Codebook `json:"codebook"`
Dataset Dataset `json:"dataset"`
}
GetCodebookRequest holds the response body for GET /codebook/{dataset}?cats=xxx&v=xxx
type MapFrom ¶ added in v1.39.0
type MapFrom struct {
SourceNames []string `json:"sourceNames,omitempty"`
Code []string `json:"codes,omitempty"`
}
MapFrom represents the 'mapFrom' object from variable when category information is included
type Variable ¶
type Variable struct {
Name string `json:"name"`
Label string `json:"label"`
Len int `json:"len"`
Codes []string `json:"codes,omitempty"`
Labels []string `json:"labels,omitempty"`
MapFrom []MapFrom `json:"mapFrom,omitempty"`
}
Variable represents a 'variable' object returned from Cantabular