webApi

package module
v0.0.0-...-89fe5e3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOutboundIP

func GetOutboundIP() net.IP

Types

type Category

type Category struct {
	Id     int    `json:"id" db:"category_id,omitempty"`
	UserId int    `json:"user_id" db:"user_id"`
	Title  string `json:"title" db:"title" binding:"required"`
	Colour string `json:"colour" db:"colour"`
}

type Day

type Day struct {
	TasksCount     int `json:"tasks_count"`
	EventsCount    int `json:"events_count"`
	DeadlinesCount int `json:"deadlines_count"`
}

type Event

type Event struct {
	Id                 int       `json:"id" db:"event_id,omitempty"`
	UserId             int       `json:"user_id" db:"user_id"`
	CategoryId         int       `json:"category_id" db:"category_id" binding:"required"`
	Title              string    `json:"title" db:"title" binding:"required"`
	Description        string    `json:"description" db:"description"`
	StartTimestamp     time.Time `json:"start_timestamp" db:"start_timestamp" binding:"required"`
	EndTimestamp       time.Time `json:"end_timestamp" db:"end_timestamp" binding:"required"`
	IsFullDay          bool      `json:"is_full_day" db:"is_full_day"`
	EventLocation      string    `json:"event_location" db:"event_location"`
	RepeatPeriodDays   int       `json:"repeat_period_days" db:"repeat_period_days"`
	EndPeriodTimestamp time.Time `json:"end_period_timestamp" db:"end_period_timestamp"`
}

type Group

type Group struct {
	GroupName  string `json:"group_name"`
	CategoryId int    `json:"category_id"`
}

type Notion

type Notion struct {
	Id          int       `json:"id" db:"notion_id,omitempty"`
	UserId      int       `json:"user_id" db:"user_id"`
	CategoryId  int       `json:"category_id" db:"category_id" binding:"required"`
	Title       string    `json:"title" db:"title" binding:"required"`
	NotionText  string    `json:"notion_text" db:"notion_text"`
	CreatedDate time.Time `json:"created_date" db:"created_date" binding:"required"`
	LastUpdate  time.Time `json:"last_update" db:"last_update"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func (*Server) Run

func (s *Server) Run(port string, handler http.Handler) error

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

type Task

type Task struct {
	Id           int       `json:"id" db:"task_id,omitempty"`
	UserId       int       `json:"user_id" db:"user_id"`
	CategoryId   int       `json:"category_id" db:"category_id" binding:"required"`
	Title        string    `json:"title" db:"title" binding:"required"`
	Description  string    `json:"description" db:"description"`
	Deadline     time.Time `json:"deadline" db:"deadline"`
	DateTime     time.Time `json:"date_time" db:"date_time" binding:"required"`
	CreationDate time.Time `json:"creation_date" db:"creation_date" binding:"required"`
	Priority     int       `json:"priority" db:"priority"`
	IsDone       bool      `json:"is_done" db:"is_done"`
}

type UpdateCategoryInput

type UpdateCategoryInput struct {
	Title  *string `json:"title"`
	Colour *string `json:"colour"`
}

func (UpdateCategoryInput) Validate

func (i UpdateCategoryInput) Validate() error

type UpdateEventInput

type UpdateEventInput struct {
	CategoryId         *int       `json:"category_id"`
	Title              *string    `json:"title"`
	Description        *string    `json:"description"`
	StartTimestamp     *time.Time `json:"start_timestamp"`
	EndTimestamp       *time.Time `json:"end_timestamp"`
	IsFullDay          *bool      `json:"is_full_day"`
	EventLocation      *string    `json:"event_location"`
	RepeatPeriodDays   *int       `json:"repeat_period_days"`
	EndPeriodTimestamp *time.Time `json:"end_period_timestamp"`
}

func (UpdateEventInput) Validate

func (i UpdateEventInput) Validate() error

type UpdateNotionInput

type UpdateNotionInput struct {
	CategoryId *int       `json:"category_id"`
	Title      *string    `json:"title"`
	NotionText *string    `json:"notion_text"`
	LastUpdate *time.Time `json:"last_update"`
}

func (UpdateNotionInput) Validate

func (i UpdateNotionInput) Validate() error

type UpdateTaskInput

type UpdateTaskInput struct {
	CategoryId  *int       `json:"category_id"`
	Title       *string    `json:"title"`
	Description *string    `json:"description"`
	Deadline    *time.Time `json:"deadline"`
	DateTime    *time.Time `json:"date_time"`
	Priority    *int       `json:"priority"`
	IsDone      *bool      `json:"is_done"`
}

func (UpdateTaskInput) Validate

func (i UpdateTaskInput) Validate() error

type User

type User struct {
	Id       int    `json:"-" db:"user_id"`
	Username string `json:"username" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type UsernameInfo

type UsernameInfo struct {
	Username string `json:"username"`
}

type Week

type Week struct {
	Days []Day `json:"week"`
}

type WeekRequest

type WeekRequest struct {
	FirstDay time.Time `json:"first_day"`
	LastDay  time.Time `json:"last_day"`
}

Directories

Path Synopsis
pkg
service/goics
Package goics is a toolkit for encoding and decoding ics/Ical/icalendar files.
Package goics is a toolkit for encoding and decoding ics/Ical/icalendar files.

Jump to

Keyboard shortcuts

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