Documentation
¶
Index ¶
- Constants
- func GeoTypeMap() map[string]string
- func GetDataSet(varCode string) string
- func ParseMetric(geo, cats Pairs, values IntValues) string
- func ParseResp(query interface{})
- func ShortVarMap() map[string]string
- type AuthTripper
- type ClassCodes
- type Client
- func (cant *Client) Checker(ctx context.Context, state *healthcheck.CheckState) error
- func (cant *Client) QueryMetaData(ctx context.Context, ds string, nomis bool) (string, error)
- func (cant *Client) QueryMetric(ctx context.Context, ds, geoType, code string) (geoq, catsQL Pairs, values IntValues, err error)
- func (cant *Client) QueryMetricFilter(ctx context.Context, ds, geo, geoType, code string) (geoq, catsQL Pairs, values IntValues, err error)
- func (cant *Client) SendQueryVars(ctx context.Context, query interface{}, vars map[string]interface{}) error
- type DataSets
- type IntValues
- type Metadata
- type Metric
- type MetricFilter
- type Pairs
- type VariableCodes
Constants ¶
View Source
const URL = "https://ftb-api-ext.ons.sensiblecode.io/graphql"
Variables ¶
This section is empty.
Functions ¶
func GeoTypeMap ¶
func ParseMetric ¶
func ParseResp ¶
func ParseResp(query interface{})
ParseResp is used for the command line investigate API commands probably doesn't make sense for REST API
func ShortVarMap ¶
Types ¶
type AuthTripper ¶
type ClassCodes ¶
type ClassCodes struct {
Dataset struct {
Table struct {
Dimensions []struct {
Categories Pairs
}
} `graphql:"table(variables: [$vars])"`
} `graphql:"dataset(name: $ds)"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Checker ¶
func (cant *Client) Checker(ctx context.Context, state *healthcheck.CheckState) error
func (*Client) QueryMetaData ¶
func (*Client) QueryMetric ¶
func (cant *Client) QueryMetric(ctx context.Context, ds, geoType, code string) (geoq, catsQL Pairs, values IntValues, err error)
{ dataset(name: "Usual-Residents") {
table(
variables: ["LA", "HLQPUK11_T007A"]
) {
dimensions {
categories {
label
code
}
}
values
error
}
}
}
QueryMetric is is a cli query2 could be entrypoint for REST endpoint
func (*Client) QueryMetricFilter ¶
func (cant *Client) QueryMetricFilter(ctx context.Context, ds, geo, geoType, code string) (geoq, catsQL Pairs, values IntValues, err error)
{ dataset(name: "Usual-Residents") {
table(
variables: ["COUNTRY", "HLQPUK11_T007A"]
filters: [{variable: "COUNTRY", codes: ["synE92000001"]}]
) {
dimensions {
categories {
label
code
}
}
values
error
}
}
}
MetricFilter is a cli type query1 could be entrypoint for REST endpoint
type Metadata ¶
type Metadata struct {
Code string
Name string
Categories []struct {
Code string
Name string
} `json:"categories"`
}
Metadata is a slow, tactical solution
type MetricFilter ¶
Click to show internal directories.
Click to hide internal directories.