loadshedding

package
v0.0.0-...-5673848 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: MIT Imports: 9 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 {
	// contains filtered or unexported fields
}

Client export

func NewClient

func NewClient(location *time.Location, debug bool) *Client

NewClient export

func (*Client) GetMunicipalities

func (c *Client) GetMunicipalities(province Province) ([]Municipality, error)

GetMunicipalities export

func (*Client) GetMunicipalitySuburbs

func (c *Client) GetMunicipalitySuburbs(req GetMunicipalitySuburbsRequest) ([]Suburb, error)

GetMunicipalitySuburbs export

func (*Client) GetSchedule

func (c *Client) GetSchedule(req GetScheduleRequest) (*Schedule, error)

GetSchedule export

func (*Client) GetStatus

func (c *Client) GetStatus() (Stage, error)

GetStatus export

func (*Client) SearchSuburbs

func (c *Client) SearchSuburbs(req SearchSuburbsRequest) ([]SearchSuburb, error)

SearchSuburbs export

type GetMunicipalitySuburbsRequest

type GetMunicipalitySuburbsRequest struct {
	MunicipalityID string
	Search         string
	PageSize       int
}

GetMunicipalitySuburbsRequest export

type GetMunicipalitySuburbsResponse

type GetMunicipalitySuburbsResponse struct {
	Total   int
	Results []Suburb
}

GetMunicipalitySuburbsResponse export

type GetScheduleRequest

type GetScheduleRequest struct {
	Stages   []Stage
	SuburbID string
}

GetScheduleRequest export

type Municipality

type Municipality struct {
	ID   string `json:"Value"`
	Name string `json:"Text"`
}

Municipality export

type Province

type Province int

Province Export

const (
	ProvinceUnknown     Province = -1
	ProvinceEasternCape Province = iota
	ProvinceFreeState
	ProvinceGauteng
	ProvinceKwazuluNatal
	ProvinceLimpopo
	ProvinceMpumalanga
	ProvinceNorthWest
	ProvinceNorthernCape
	ProvinceWesternCape
)

type Schedule

type Schedule struct {
	Schedule []ScheduleDay
}

Schedule export

type ScheduleDay

type ScheduleDay struct {
	Date  time.Time
	Slots []ScheduleSlot
}

ScheduleDay export

type ScheduleSlot

type ScheduleSlot struct {
	Start    time.Time
	Stage    Stage
	Duration time.Duration
}

ScheduleSlot export

type ScheduleSlotByDay

type ScheduleSlotByDay []ScheduleDay

func (ScheduleSlotByDay) Len

func (a ScheduleSlotByDay) Len() int

func (ScheduleSlotByDay) Less

func (a ScheduleSlotByDay) Less(i, j int) bool

func (ScheduleSlotByDay) Swap

func (a ScheduleSlotByDay) Swap(i, j int)

type ScheduleSlotByStart

type ScheduleSlotByStart []ScheduleSlot

func (ScheduleSlotByStart) Len

func (a ScheduleSlotByStart) Len() int

func (ScheduleSlotByStart) Less

func (a ScheduleSlotByStart) Less(i, j int) bool

func (ScheduleSlotByStart) Swap

func (a ScheduleSlotByStart) Swap(i, j int)

type SearchSuburb

type SearchSuburb struct {
	ID    int `json:"Id"`
	Total int `json:"Total"`

	Municipality string `json:"MunicipalityName"`
	Province     string `json:"ProvinceName"`
	Suburb       string `json:"Name"`
}

SearchSuburb export

type SearchSuburbsRequest

type SearchSuburbsRequest struct {
	Search     string
	MaxResults int
}

SearchSuburbsRequest export

type Stage

type Stage int

Stage Export

const (
	StageUnknown         Stage = -1
	StageNotLoadShedding Stage = iota
	Stage1
	Stage2
	Stage3
	Stage4
	Stage5
	Stage6
	Stage7
	Stage8
)

func ConvertStage

func ConvertStage(stage string) Stage

ConvertStage export

type Suburb

type Suburb struct {
	ID    string `json:"id"`
	Name  string `json:"text"`
	Total int    `json:"Tot"`
}

Suburb export

Jump to

Keyboard shortcuts

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