mi: within.website/mi/switchcounter Index | Files

package switchcounter

import "within.website/mi/switchcounter"

Index

Package Files

ingest.go pluralkit.go storage.go switch.go switchcounter.go

type Switch Uses

type Switch struct {
    ID        string        `json:"id"`
    Who       string        `json:"who"`
    StartedAt time.Time     `json:"started_at"`
    EndedAt   *time.Time    `json:"ended_at"`
    Duration  time.Duration `json:"duration"`
}

type Switches Uses

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

func New Uses

func New(session *r.Session, mux *http.ServeMux) *Switches

func (*Switches) ByID Uses

func (s *Switches) ByID(ctx context.Context, id string) (*Switch, error)

func (*Switches) Current Uses

func (s *Switches) Current(rw http.ResponseWriter, req *http.Request)

func (*Switches) Get Uses

func (s *Switches) Get(ctx context.Context, limit, page int) ([]Switch, error)

func (*Switches) GetID Uses

func (s *Switches) GetID(rw http.ResponseWriter, req *http.Request)

func (*Switches) GetSwitches Uses

func (s *Switches) GetSwitches(rw http.ResponseWriter, req *http.Request)

func (*Switches) ImportCSV Uses

func (s *Switches) ImportCSV(r io.Reader) ([]Switch, error)

func (*Switches) RegisterSwitch Uses

func (s *Switches) RegisterSwitch(rw http.ResponseWriter, req *http.Request)

func (*Switches) Switch Uses

func (s *Switches) Switch(ctx context.Context, who string) (Switch, Switch, error)

Package switchcounter imports 17 packages (graph) and is imported by 1 packages. Updated 2020-02-22. Refresh now. Tools for package owners.