Documentation
¶
Index ¶
- Variables
- func CancelCode(link string) (string, error)
- func ParseDate(value string) (time.Time, error)
- type Availability
- type AvailabilityOptions
- type Booking
- type Cancellation
- type Category
- type CategoryInfo
- type CategorySchedule
- type Client
- func (c *Client) Availability(ctx context.Context, options AvailabilityOptions) (Availability, error)
- func (c *Client) Book(ctx context.Context, selection Selection, details ReservationDetails) (reservation Reservation, resultErr error)
- func (c *Client) Bookings(ctx context.Context, code string) ([]Booking, error)
- func (c *Client) Cancel(ctx context.Context, code string, bookingID int) (Cancellation, error)
- func (c *Client) Release(ctx context.Context) error
- func (c *Client) Schedule(ctx context.Context, options ScheduleOptions) (Schedule, error)
- func (c *Client) Space(ctx context.Context, id int) (Space, error)
- func (c *Client) Spaces(ctx context.Context, selector Category) ([]Space, error)
- type Doer
- type Error
- type Interval
- type Reservation
- type ReservationDetails
- type ResponseError
- type Schedule
- type ScheduleOptions
- type Selection
- type Space
- type SpaceSchedule
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAuthenticationRequired = &Error{ Code: "libcal_authentication_required", Message: "LibCal needs a USC sign-in", Cause: &auth.SiteError{Site: auth.SiteLibCal, Err: auth.ErrCredentialsRequired}, }
View Source
var ErrBookingUnknown = &Error{Code: "libcal_booking_unknown", Message: "LibCal booking outcome is unknown; check the confirmation email, then release the checkout before booking again"}
Functions ¶
func CancelCode ¶ added in v0.1.1
Types ¶
type Availability ¶ added in v0.1.1
type AvailabilityOptions ¶ added in v0.1.1
type Cancellation ¶ added in v0.1.1
type CategoryInfo ¶
type CategoryInfo struct {
ID int `json:"id"`
Name string `json:"name"`
Slug Category `json:"slug"`
Kind string `json:"kind"`
}
func Categories ¶
func Categories() []CategoryInfo
type CategorySchedule ¶
type CategorySchedule struct {
Category CategoryInfo `json:"category"`
WindowEnd bool `json:"window_end"`
Spaces []SpaceSchedule `json:"spaces"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Availability ¶ added in v0.1.1
func (c *Client) Availability(ctx context.Context, options AvailabilityOptions) (Availability, error)
func (*Client) Book ¶
func (c *Client) Book(ctx context.Context, selection Selection, details ReservationDetails) (reservation Reservation, resultErr error)
type Reservation ¶
type ReservationDetails ¶
type ResponseError ¶
func (*ResponseError) Error ¶
func (e *ResponseError) Error() string
func (*ResponseError) ErrorCode ¶
func (e *ResponseError) ErrorCode() string
func (*ResponseError) Unwrap ¶
func (e *ResponseError) Unwrap() error
type Schedule ¶
type Schedule struct {
StartDate string `json:"start_date"`
EndDate string `json:"end_date"`
Timezone string `json:"timezone"`
Categories []CategorySchedule `json:"categories"`
}
func (Schedule) Availability ¶ added in v0.1.1
func (s Schedule) Availability(start, end time.Time) (Availability, error)
type ScheduleOptions ¶
type Selection ¶
type SpaceSchedule ¶
Click to show internal directories.
Click to hide internal directories.