score

package
v0.0.0-...-2015dc4 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Preprocess

func Preprocess(scores Countries)

Add BT logic to categorise country

func WriteBuf

func WriteBuf(countries Countries) ([]byte, error)

Types

type Countries

type Countries map[string]Country

func ReadBuf

func ReadBuf(buf []byte) (Countries, error)

type Country

type Country struct {
	Name              string  `json:"country"`
	IsTerritory       bool    `json:"is_territory"`
	Score             *int    `json:"score"`
	Status            *string `json:"status"`
	PoliticalRights   *int    `json:"political_rights"`
	CivilLiberties    *int    `json:"civil_liberties"`
	ObstaclesToAccess *int    `json:"obstacle_to_access"`
	LimitsOnContent   *int    `json:"limits_on_content"`
	ViolationsOfUR    *int    `json:"violations_of_UR"`
	NetScore          *int    `json:"net_score"`
	NetStatus         *string `json:"net_status"`
	Risk              *string `json:"risk"`
}

type Diff

type Diff struct {
	Type string   `json:"type"`
	Base *Country `json:"base_country"`
	New  *Country `json:"new_country"`
}

type DiffMap

type DiffMap map[string]Diff

func GetDiff

func GetDiff(c1 Countries, c2 Countries) DiffMap

func (*DiffMap) GetSorted

func (diffs *DiffMap) GetSorted() []Diff

func (*DiffMap) RenderEmail

func (diffs *DiffMap) RenderEmail(store storage.Storage, templateFileName string) (*string, error)

func (*DiffMap) SplitMinors

func (diffs *DiffMap) SplitMinors() (DiffMap, DiffMap)

Jump to

Keyboard shortcuts

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