scotusdb

package
v0.0.0-...-e97ee80 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultModernCasesURL = "http://scdb.wustl.edu/_brickFiles/2021_01/SCDB_2021_01_justiceCentered_Citation.csv.zip"
	DefaultLegacyCasesURL = "http://scdb.wustl.edu/_brickFiles/Legacy_07/SCDB_Legacy_07_justiceCentered_Citation.csv.zip"
	DefaultOT21CasesURL   = "" /* 132-byte string literal not displayed */
	DefaultDataDir        = "data"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Case

type Case struct {
	ID            string    `json:"id"`
	Name          string    `json:"name"`
	MajorityVotes int       `json:"majority-votes"`
	MinorityVotes int       `json:"minority-votes"`
	DecisionDate  time.Time `json:"decision-date"`
	Votes         []*Vote   `json:"votes"`
	Chief         string    `json:"chief"`
}

type Decision

type Decision byte
const (
	Abstained       Decision = 'x'
	AgainstMajority Decision = '-'
	WithMajority    Decision = '+'
)

func (Decision) MarshalJSON

func (d Decision) MarshalJSON() ([]byte, error)

func (*Decision) UnmarshalJSON

func (d *Decision) UnmarshalJSON(b []byte) error

type Direction

type Direction string
const (
	Unknown      Direction = "?"
	Liberal      Direction = "L"
	Conservative Direction = "C"
)

type Option

type Option func(o *Options)

func WithCaseURLs

func WithCaseURLs(
	modernCasesURL string,
	legacyCasesURL string,
	ot21CasesURL string,
) Option

func WithDataDir

func WithDataDir(dir string) Option

func WithHTTPClient

func WithHTTPClient(c *http.Client) Option

type Options

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

type Term

type Term struct {
	Year  int     `json:"year"`
	Cases []*Case `json:"cases"`
}

func Read

func Read(
	ctx context.Context,
	opts ...Option,
) ([]*Term, error)

type Vote

type Vote struct {
	ID          string    `json:"id"`
	JusticeName string    `json:"justice-name"`
	Decision    Decision  `json:"decision"`
	Direction   Direction `json:"direction"`
}

Jump to

Keyboard shortcuts

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