calendar

package
v0.0.0-...-18a316a Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllCategories []Category
View Source
var AllLongEvents []LongEvent
View Source
var AllShortEvents []ShortEvent
View Source
var CurrentCategoryID int = 1
View Source
var CurrentLongEventID int = 1
View Source
var CurrentShortEventID int = 1

Functions

func CORSMiddleware

func CORSMiddleware() gin.HandlerFunc

CORSMiddleware middleware headers for any RESTful requests {{{

func CheckCategoryExist

func CheckCategoryExist(targetCategory int) bool

func CreateCategory

func CreateCategory(c *gin.Context)

func CreateLongEvent

func CreateLongEvent(c *gin.Context)

func CreateShortEvent

func CreateShortEvent(c *gin.Context)

func DeleteCategory

func DeleteCategory(c *gin.Context)

func DeleteLongEvent

func DeleteLongEvent(c *gin.Context)

func DeleteShortEvent

func DeleteShortEvent(c *gin.Context)

func EditCategory

func EditCategory(c *gin.Context)

func EditLongEvent

func EditLongEvent(c *gin.Context)

func EditShortEvent

func EditShortEvent(c *gin.Context)

func FindCategory

func FindCategory(num int) (bool, int)

func FindLongEvent

func FindLongEvent(targetEvent int) (bool, int)

func FindShortEvent

func FindShortEvent(targetEvent int) (bool, int)

func FormatToDate

func FormatToDate(dateStr string) (error, time.Time)

func GetAllCategories

func GetAllCategories(c *gin.Context)

func GetAllEvents

func GetAllEvents(c *gin.Context)

func GetCategoryEvents

func GetCategoryEvents(c *gin.Context)

func GetDayData

func GetDayData(c *gin.Context)

func GetEndDay

func GetEndDay(t time.Time) time.Time

func GetLongEvents

func GetLongEvents(c *gin.Context)

func GetShortEvents

func GetShortEvents(c *gin.Context)

func GetStartDay

func GetStartDay(t time.Time) time.Time

func Start

func Start(args []string)

Types

type Category

type Category struct {
	ID    int
	Name  string
	Color string
}

type EditCategoryReq

type EditCategoryReq struct {
	ID    int    `form:"id" binding:"required"`
	Name  string `form:"name" binding:"required"`
	Color string `form:"color" binding:"required"`
}

type EditLongEventReq

type EditLongEventReq struct {
	ID          int    `form:"id" binding:"required"`
	Category    int    `form:"category"`
	Title       string `form:"title" binding:"required"`
	Description string `form:"description" binding:"required"`
	StartTime   string `form:"start_time" binding:"required"`
	EndTime     string `form:"end_time" binding:"required"`
}

type EditShortEventReq

type EditShortEventReq struct {
	ID          int    `form:"id" binding:"required"`
	Category    int    `form:"category"`
	Title       string `form:"title" binding:"required"`
	Description string `form:"description" binding:"required"`
	Time        string `form:"time" binding:"required"`
}

type IDReq

type IDReq struct {
	ID int `form:"id" binding:"required"`
}

type LongEvent

type LongEvent struct {
	ID          int
	Category    int
	Title       string
	Description string
	StartTime   time.Time
	EndTime     time.Time
}

type LongEventExpanded

type LongEventExpanded struct {
	ID          int
	Category    Category
	Title       string
	Description string
	StartTime   time.Time
	EndTime     time.Time
}

func GetLongCategory

func GetLongCategory(event LongEvent) LongEventExpanded

type NewCategoryReq

type NewCategoryReq struct {
	Name  string `form:"name" binding:"required"`
	Color string `form:"color" binding:"required"`
}

type NewLongEventReq

type NewLongEventReq struct {
	Title       string `form:"title" binding:"required"`
	Category    int    `form:"category"`
	Description string `form:"description" binding:"required"`
	StartTime   string `form:"start_time" binding:"required"`
	EndTime     string `form:"end_time" binding:"required"`
}

type NewShortEventReq

type NewShortEventReq struct {
	Category    int    `form:"category"`
	Title       string `form:"title" binding:"required"`
	Description string `form:"description" binding:"required"`
	Time        string `form:"time" binding:"required"`
}

type ShortEvent

type ShortEvent struct {
	ID          int
	Category    int
	Title       string
	Description string
	Time        time.Time
}

type ShortEventExpanded

type ShortEventExpanded struct {
	ID          int
	Category    Category
	Title       string
	Description string
	Time        time.Time
}

func GetShortCategory

func GetShortCategory(event ShortEvent) ShortEventExpanded

type TimeReq

type TimeReq struct {
	Time string `form:"day" binding:"required"`
}

Jump to

Keyboard shortcuts

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