client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AvailabilityResponse

type AvailabilityResponse struct {
	Campsites map[string]*models.Campsite `json:"campsites"`
	Count     int                         `json:"count"`
}

type Client

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

Client is an HTTP client that interacts with the recreation.gov API.

func New

func New(l log15.Logger, timeout time.Duration) *Client

func (*Client) Availability

func (c *Client) Availability(campgroundID string, start, end time.Time) (models.Campsites, error)

func (*Client) Do

func (c *Client) Do(path string, queryParams url.Values) (*http.Response, error)

func (*Client) Poll

func (c *Client) Poll(ctx context.Context, campgroundID string, start, end time.Time, interval time.Duration) (models.Campsites, error)

Poll is a blocking operation. To poll multiple campgrounds call this method in its own goroutine.

func (*Client) Search

func (c *Client) Search(query string) ([]models.Campground, error)

type SearchResponse

type SearchResponse struct {
	Campgrounds []models.Campground `json:"inventory_suggestions"`
}

Jump to

Keyboard shortcuts

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