sysvak

package
v0.0.0-...-496275f Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AgeRangeToString = map[int]string{
	1: "0-15",
	2: "16-44",
	3: "45-54",
	4: "55-64",
	5: "65-74",
	6: "75-84",
	7: "> 85",
}

AgeRangeToString ...

View Source
var GenderToString = map[int]string{
	1: "Kvinne",
	2: "Mann",
}

GenderToString ...

View Source
var MunicipalityByCode = make(map[string]Municipality)

MunicipalityByCode maps from Norwegian municipality codes to Municipality struct

View Source
var StringToAgeRange = map[string]int{
	"0-15 år":    1,
	"16-44 år":   2,
	"45-54 år":   3,
	"55-64 år":   4,
	"65-74 år":   5,
	"75-84 år":   6,
	"85 og over": 7,
}

StringToAgeRange ...

View Source
var StringToDose = map[string]int{
	"Dose 1": 1,
	"Dose 2": 2,
}

StringToDose ...

View Source
var StringToGender = map[string]int{
	"Kvinne": 1,
	"Mann":   2,
}

StringToGender ...

Functions

This section is empty.

Types

type Municipality

type Municipality struct {
	Code string
	Name string
}

Municipality ...

func SearchMunicipality

func SearchMunicipality(s string) []Municipality

SearchMunicipality returns []Municipality for which s matches subscrint of Name

type MunicipalityCode

type MunicipalityCode string

MunicipalityCode is the 4 digit municipality code for Norwegian municipalities

type Query

type Query struct {
	From           time.Time
	To             time.Time
	Doses          []string
	Municipalities []string
	Genders        []string
	Ages           []string
}

Query ...

func NewQuery

func NewQuery() Query

NewQuery creates a new query with reasonable defaults

func (Query) AsURL

func (q Query) AsURL() (string, error)

AsURL returns query as URL

type RawResult

type RawResult struct {
	Description string    `json:"tekst"`
	Count       int       `json:"antall"`
	Where       string    `json:"fordeltPaa,omitempty"`
	Order       int       `json:"rekkefolge,omitempty"`
	Date        time.Time `json:"provedato,omitempty"`
	Month       int       `json:"manedNr,omitempty"`
}

RawResult ...

func (*RawResult) Parse

func (r *RawResult) Parse() Result

Parse and return normalized result

type Result

type Result struct {
	Description string
	Gender      int
	Dose        int
	Age         int
	Where       string
	Date        time.Time
	Order       int
	Month       int
	Count       int
}

Result ...

func Lookup

func Lookup(q Query) ([]Result, error)

Lookup ...

Jump to

Keyboard shortcuts

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