x: within.website/x/web/switchcounter Index | Files

package switchcounter

import "within.website/x/web/switchcounter"

Package switchcounter is a simple interface to the https://www.switchcounter.science/ API.


Package Files


func Validate Uses

func Validate(resp *http.Response) error

Validate ensures a HTTP response contains the expected fields.

type API Uses

type API struct {
    // contains filtered or unexported fields

API is a builder for HTTP requests to interface with Switch Counter.

func NewHTTPClient Uses

func NewHTTPClient(webhookURL string) API

NewHTTPClient creates a new instance of API over HTTP.

func (API) Status Uses

func (a API) Status() *http.Request

Status returns a request for which systemmate is currently in front.

func (API) Switch Uses

func (a API) Switch(front string) *http.Request

Switch changes the recorded front to the given systemmate.

type Status Uses

type Status struct {
    Front     string    `json:"member_name"`
    StartedAt time.Time `json:"started_at"`

Status is the API response.

Package switchcounter imports 5 packages (graph) and is imported by 4 packages. Updated 2019-06-07. Refresh now. Tools for package owners.