objects

package
v0.0.0-...-15721c5 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const MaxListLimit = 200

MaxListLimit maximum listting

Variables

This section is empty.

Functions

This section is empty.

Types

type CancelRequest

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

CancelRequest to cancel an Event

type CreateRequest

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

CreateRequest for creating a new Event

type DeleteRequest

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

DeleteRequest to delete an Event

type Event

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

	// General details
	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"`

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

	// Change 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:"-"`
}

EventResponseWrapper reponse of any Event request

func (*EventResponseWrapper) JSON

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

JSON convert EventResponseWrapper in json

func (*EventResponseWrapper) StatusCode

func (e *EventResponseWrapper) StatusCode() int

StatusCode return status code

type EventStatus

type EventStatus string

EventStatus defines the status of the event

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

Some default event status

type GetRequest

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

GetRequest for retrieving single Event

type ListRequest

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

ListRequest for retrieving list of Events

type RescheduleRequest

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

RescheduleRequest to reschedule an Event

type TimeSlot

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

TimeSlot for Event

type UpdateDetailsRequest

type UpdateDetailsRequest 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"`
}

UpdateDetailsRequest to update existing Event

Jump to

Keyboard shortcuts

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