api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthToken

type AuthToken struct {
	ApiKey    string `json:"api_key"`
	AuthToken string `json:"auth_token"`
}

type AuthTokenEnvelope

type AuthTokenEnvelope struct {
	AuthToken AuthToken `json:"auth_token"`
}

type Client

type Client struct {
	ApiKey     string
	AuthToken  string
	HttpClient *resty.Client
}

func NewAuthenticatedClient

func NewAuthenticatedClient(apiKey, authToken string) *Client

func NewClient

func NewClient(apiKey, email, password string) (*Client, error)

func (Client) AllTrips

func (c Client) AllTrips() iter.Seq2[[]Trip, error]

func (Client) AllTripsWithDelay

func (c Client) AllTripsWithDelay(d time.Duration) iter.Seq2[[]Trip, error]

func (Client) Close

func (c Client) Close() error

type ResponseMetadata

type ResponseMetadata struct {
	Pagination ResponseMetadataPagination `json:"pagination"`
}

type ResponseMetadataPagination

type ResponseMetadataPagination struct {
	NextPageUrl string `json:"next_page_url"`
	PageCount   int    `json:"page_count"`
	RecordCount int    `json:"record_count"`
}

type Trip

type Trip struct {
	DepartedAt time.Time `json:"departed_at"`
	Distance   int       `json:"distance"`
	Id         int       `json:"id"`
	Name       string    `json:"name,omitempty"`
	Url        string    `json:"url"`
}

func (Trip) String

func (t Trip) String() string

type TripsEnvelope

type TripsEnvelope struct {
	Metadata ResponseMetadata `json:"meta"`
	Trips    []Trip           `json:"trips"`
}

type User

type User struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type UserEnvelope

type UserEnvelope struct {
	User User `json:"user"`
}

Jump to

Keyboard shortcuts

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