Documentation ¶
Index ¶
Constants ¶
View Source
const MaxListLimit = 200
MaxListLimit holds the maximum number of listings.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CancelRequest ¶
type CancelRequest struct {
ID string `json:"id"`
}
CancelRequest is for canceling an existing Event.
type CreateRequest ¶
type CreateRequest struct {
Event *Event `json:"event"`
}
CreateRequest is for creating a new Event.
type DeleteRequest ¶
type DeleteRequest struct {
ID string `json:"id"`
}
DeleteRequest is for deleting an existing Event.
type Event ¶
type Event struct { ID string `gorm:"primary_key" json:"id,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Website string `json:"website,omitempty"` Address string `json:"address,omitempty"` PhoneNumber string `json:"phone-number,omitempty"` TimeSlot *TimeSlot `gorm:"embedded" json:"time-slot,omitempty"` Status EventStatus `json:"status,omitempty"` CreatedAt time.Time `json:"created-at,omitempty"` UpdatedAt time.Time `json:"updated-at,omitempty"` CanceledAt time.Time `json:"canceled-at,omitempty"` RescheduledAt time.Time `json:"rescheduled-at,omitempty"` }
Event object for the API.
type EventResponse ¶
type EventResponse struct { Event *Event `json:"event,omitempty"` Events []*Event `json:"events,omitempty"` Code int `json:"-"` }
EventResponse holds the response to any event request.
func (*EventResponse) Json ¶
func (e *EventResponse) Json() []byte
func (*EventResponse) StatusCode ¶
func (e *EventResponse) StatusCode() int
StatusCode returns the HTTP status code of an EventResponse.
type EventStatus ¶
type EventStatus string
EventStatus holds the status of the event.
const ( Original EventStatus = "original" Canceled EventStatus = "canceled" Rescheduled EventStatus = "rescheduled" )
Default event statuses.
type GetRequest ¶
type GetRequest struct {
ID string `json:"id"`
}
GetRequest is for retrieving a single Event.
type ListRequest ¶
type ListRequest struct { Limit int `json:"limit"` After string `json:"after"` // for paging Name string `json:"name"` // optional name matching }
ListRequest is for getting a list of Events.
type RescheduleRequest ¶
type RescheduleRequest struct { ID string `json:"id"` NewTimeSlot *TimeSlot `json:"new-time-slot"` }
RescheduleRequest is for rescheduling an existing Event.
Click to show internal directories.
Click to hide internal directories.