Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessToken ¶
type AccessToken string
An AccessToken is used to authenticate requests to the Recurse API.
type AccessTokenFunc ¶
type AccessTokenFunc func(context.Context) (AccessToken, error)
AccessTokenFunc returns the current Recurse API access token.
func StaticAccessToken ¶
func StaticAccessToken(token string) AccessTokenFunc
StaticAccessToken makes an AccessTokenFunc that always returns the provided access token.
type Batch ¶
A Batch is a cycle of the Recurse Center retreat.
https://github.com/recursecenter/wiki/wiki/Recurse-Center-API#Batches
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client sends HTTP requests to the Recurse API.
func NewClient ¶
func NewClient(accessToken AccessTokenFunc, opts ...ClientOpt) (*Client, error)
NewClient creates a new Recurse API client.
func (*Client) ActiveRecursers ¶
ActiveRecursers fetches the profiles for all recursers currently at RC.
https://github.com/recursecenter/wiki/wiki/Recurse-Center-API#search
func (*Client) AllBatches ¶
AllBatches returns all RC batches up to the current batch with the most recent batch first.
https://github.com/recursecenter/wiki/wiki/Recurse-Center-API#list-all-batches
type ClientOpt ¶
A ClientOpt is used to configure a Client.
func WithBaseURL ¶
WithBaseURL sets a custom Recurse API URL.
The default value is "https://www.recurse.com/api/v1".
type Datestamp ¶
Datestamp is a time.Time wrapper for parsing dates. It implements json.Unmarshaler by parsing the value with time.DateOnly in UTC.
func (*Datestamp) MarshalJSON ¶
func (*Datestamp) UnmarshalJSON ¶
type Profile ¶
A Profile contains information about a Recurser.
Profile data is updated at midnight on the last day (Friday) of a batch.
https://github.com/recursecenter/wiki/wiki/Recurse-Center-API#Profiles
type ResponseError ¶
ResponseError is the type of error returned when the response status indicates an error (400 or greater).
func (*ResponseError) Error ¶
func (r *ResponseError) Error() string