Documentation
¶
Overview ¶
Package pavlok provides a wrapper for the Pavlok API.
Index ¶
Constants ¶
View Source
const (
DefaultBaseURL = "https://api.pavlok.com/api/v5"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client is a client to the Pavlok API.
func NewClient ¶
func NewClient(apiKey string, options ...OptionsFunc) *Client
NewClient creates a new client to the Pavlok API.
func (*Client) SendStimulus ¶
SendStimulus sends a stimulus.
type OptionsFunc ¶
func WithBaseURL ¶
func WithBaseURL(baseURL string) OptionsFunc
func WithHTTPClient ¶
func WithHTTPClient(httpClient *http.Client) OptionsFunc
type Stimulus ¶
type Stimulus struct {
Type StimulusType `json:"stimulusType"`
Value int `json:"stimulusValue"` // 1-100, inclusive
Reason string `json:"reason,omitempty"`
}
type StimulusType ¶
type StimulusType string
const ( Zap StimulusType = "zap" Beep StimulusType = "beep" Vibe StimulusType = "vibe" )
Click to show internal directories.
Click to hide internal directories.