objects

package
v0.0.0-...-04ca4e4 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const MaxListLimit = 200

Maximum listing

Variables

This section is empty.

Functions

This section is empty.

Types

type CancelRequest

type CancelRequest struct {
	ID string `json:"id"`
}

type CreateRequest

type CreateRequest struct {
	Event *Event `json:"event"`
}

Create request

type DeleteRequest

type DeleteRequest struct {
	ID string `json:"id"`
}

type Event

type Event struct {
	ID string `gorm:"primary_key" json:"id,omitempty"`

	Name        string `json:"name"`
	Description string `json:"description"`
	Website     string `json:"website"`
	Address     string `json:"address,omitempty"`
	PhoneNumber string `json:"phone_number,omitempty"`

	// Slot duration
	Slot *TimeSlot `gorm:"embedded" json:"slot,omitempty"`

	// Status
	Status EventStatus `json:"status,omitempty"`

	// Meta information
	CreatedOn     time.Time `json:"created_on,omitempty"`
	UpdatedOn     time.Time `json:"updated_on,omitempty"`
	CancelledOn   time.Time `json:"cancelled_on,omitempty"`
	RescheduledOn time.Time `json:"rescheduled_on,omitempty"`
}

Event object for the API

type EventResponseWrapper

type EventResponseWrapper struct {
	Event  *Event   `json:"event,omitempty`
	Events []*Event `json:"events,omitempty`
	Code   int      `json:"-"`
}

Response of every Event Request

func (*EventResponseWrapper) JSON

func (e *EventResponseWrapper) JSON() []byte

EventResponseWrapper into JSON

func (*EventResponseWrapper) StatusCode

func (e *EventResponseWrapper) StatusCode() int

Status Code

type EventStatus

type EventStatus string

Defines the staus of the event

const (
	Original    EventStatus = "original"
	Cancelled   EventStatus = "cancelled"
	Rescheduled EventStatus = "rescheduled"
)

Default event status

type GetRequest

type GetRequest struct {
	ID string `json:"id"`
}

Get request

type ListRequest

type ListRequest struct {
	Limit int    `json:"limit"`
	After string `json:"after"`
	Name  string `json:"name"`
}

List request

type RescheduleRequest

type RescheduleRequest struct {
	ID      string    `json:"id"`
	NewSlot *TimeSlot `json:"new_slot"`
}

type TimeSlot

type TimeSlot struct {
	StartTime time.Time `json:"start_time,omitempty"`
	EndTime   time.Time `json:"end_time,omitempty"`
}

time slot for event

type UpdateRequest

type UpdateRequest struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Website     string `json:"website"`
	Address     string `json:"address"`
	PhoneNumber string `json:"phone_number"`
}

Jump to

Keyboard shortcuts

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