switchcounter

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2020 License: CC0-1.0 Imports: 5 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(resp *http.Response) error

Validate ensures a HTTP response contains the expected fields.

Types

type API

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

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

func NewHTTPClient

func NewHTTPClient(webhookURL string) API

NewHTTPClient creates a new instance of API over HTTP.

func (API) Status

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

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

func (API) Switch

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

Switch changes the recorded front to the given systemmate.

type Status

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

Status is the API response.

Jump to

Keyboard shortcuts

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