controllers

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collection

func Collection(c *mongo.Database)

Collection initialises new collections inside given database

func UUID

func UUID() (uuid string)

UUID generates 16 bytes unique string (NOT RFC4122 compliant)

Types

type MalformedRequest

type MalformedRequest struct {
	Status  int
	Message string
	Time    time.Time
}

MalformedRequest represents a JSON Response structure for malformed requests

type Meeting

type Meeting struct {
	ID           string        `json:"id,omitempty"`
	Title        string        `json:"title"`
	Participants []Participant `json:"participants"`
	StartTime    time.Time     `json:"start_time"`
	EndTime      time.Time     `json:"end_time"`
	CreatedAt    time.Time     `json:"created_at,omitempty"`
}

Meeting represents Meeting collection structure

type MeetingResponse

type MeetingResponse struct {
	Status  int
	Message string
	Data    []Meeting
	Time    time.Time
}

MeetingResponse represents JSON Response structure for Meeting

func CreateMeeting

func CreateMeeting(meeting Meeting) MeetingResponse

CreateMeeting creates a new meeting entry

func GetAllMeetings

func GetAllMeetings(startTime time.Time, endTime time.Time) MeetingResponse

GetAllMeetings returns all meetings scheduled between given start and end time

func GetMeetingForParticipant

func GetMeetingForParticipant(email string) MeetingResponse

GetMeetingForParticipant returns all meetings the given participant is inside

func GetSingleMeeting

func GetSingleMeeting(meetingID string) MeetingResponse

GetSingleMeeting returns full-meeting document with given meetingID

type Participant

type Participant struct {
	Name  string `json:"name,omitempty"`
	Email string `json:"email"`
	RSVP  string `json:"rsvp,omitempty"`
}

Participant represents users

type ParticipantResponse

type ParticipantResponse struct {
	Status  int
	Message string
	Data    []Participant
	Time    time.Time
}

ParticipantResponse represents JSON Response structure for Participant

type RSVPMessageType

type RSVPMessageType int32

RSVPMessageType represents the allowed RSVP messages for a meeting

Jump to

Keyboard shortcuts

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