content

package
v0.0.0-...-86b9d59 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Load and save content.json

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	Name       string `json:"name"`
	Slug       string `json:"slug"`
	Code       string `json:"code"`
	LegendStr1 string `json:"legend_str_1"`
	LegendStr2 string `json:"legend_str_2"`
	LegendStr3 string `json:"legend_str_3"`
}

type Classification

type Classification struct {
	Code                        string     `json:"code"`
	Slug                        string     `json:"slug"`
	Desc                        string     `json:"desc"`
	ChoroplethDefault           bool       `json:"choropleth_default,omitempty"`
	DotDensityDefault           bool       `json:"dot_density_default,omitempty"`
	Comparison2011DataAvailable bool       `json:"comparison_2011_data_available"`
	Categories                  []Category `json:"categories"`
}

type Content

type Content struct {
	// contains filtered or unexported fields
}

func Load

func Load(r io.Reader) (*Content, error)

func LoadName

func LoadName(name string) (*Content, error)

func (*Content) Categories

func (c *Content) Categories() []string

func (*Content) NamesToCats

func (c *Content) NamesToCats(classcode string) (map[string]string, error)

NamesToCats creates a map to lookup a category code given a category name. This is used when converting plain text headings in spreadsheets to specific category codes.

type Meta

type Meta struct {
	FirstCreatedAt                      string `json:"first_created_at"`
	CantabularMetadataSource            string `json:"cantabular_metadata_source"`
	FilteredToAtlasContentAt            string `json:"filtered_to_atlas_content_at"`
	RichContentSpecFileUsedToFilter     string `json:"rich_content_spec_file_used_to_filter"`
	LegendStrsUpdatedAt                 string `json:"legend_strs_updated_at"`
	LegendStrsFileUsed                  string `json:"legend_strs_file_used"`
	PlaceholderVariablesDescsInsertedAt string `json:"placeholder_variable_descs_inserted_at"`
}

type Topic

type Topic struct {
	Name      string     `json:"name"`
	Slug      string     `json:"slug"`
	Desc      string     `json:"desc"`
	Variables []Variable `json:"variables"`
}

type TopicGroup

type TopicGroup struct {
	Name   string  `json:"name"`
	Slug   string  `json:"slug"`
	Desc   string  `json:"desc"`
	Topics []Topic `json:"topics"`
}

type Variable

type Variable struct {
	Name            string           `json:"name"`
	Code            string           `json:"code"`
	Slug            string           `json:"slug"`
	Desc            string           `json:"desc"`
	Units           string           `json:"units"`
	Classifications []Classification `json:"classifications"`
}

Jump to

Keyboard shortcuts

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