cantabular

package
v0.0.0-...-8bc0a93 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Host    string
	HttpCli dphttp.Clienter
}

func (*Client) GetData

func (c *Client) GetData(ctx context.Context, url string) (Entity, error)

func (*Client) GetDatasetCodebook

func (c *Client) GetDatasetCodebook(ctx context.Context, dataset string) (*Codebook, error)

type Codebook

type Codebook struct {
	Dataset  Dataset     `json:"dataset"`
	CodeBook []Dimension `json:"codebook"`
}

func (*Codebook) GetDimension

func (c *Codebook) GetDimension(name string) *Dimension

type Dataset

type Dataset struct {
	Name             string `json:"name,omitempty"`
	Description      string `json:"description,omitempty"`
	Size             int    `json:"size,omitempty"`
	RuleRootVariable string `json:"rule_root_variable,omitempty"`
	Digest           string `json:"digest,omitempty"`
}

type Datasets

type Datasets struct {
	Items []*Dataset `json:"items,omitempty"`
}

type Dimension

type Dimension struct {
	Name         string   `json:"name"`
	Codes        []string `json:"codes"`
	Label        string   `json:"label"`
	Labels       []string `json:"labels"`
	MapFrom      []string `json:"mapFrom"`
	MapFromCodes []string `json:"mapFromCodes"`
}

func (*Dimension) GetChildrenForOption

func (d *Dimension) GetChildrenForOption(parentCode string, cb *Codebook, maxDepth, depth int) []*Node

func (*Dimension) GetDescendantCodeIndices

func (d *Dimension) GetDescendantCodeIndices(parentCode string) (*Index, bool)

type Entity

type Entity interface{}

type Error

type Error struct {
	StatusCode int
	Message    string
}

func (Error) Error

func (e Error) Error() string

type Hierarchy

type Hierarchy struct {
	Label    string
	Children []*Node
}

func BuildHierarchyFrom

func BuildHierarchyFrom(rootDim *Dimension, cb *Codebook, maxDepth int) *Hierarchy

type Index

type Index struct {
	Start int
	End   int
	Count int
}

type Node

type Node struct {
	Type     string
	Name     string
	Code     string
	Children []*Node
}

Jump to

Keyboard shortcuts

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