contract

package
v0.0.0-...-2d44628 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const EventLimitPerPage = 25

EventLimitPerPage specifies maximum number of events per page.

View Source
const FormDateTimeLayout = "2006-01-02T15:04"

FormDateTimeLayout is the HTML datetime-local input time format.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeleteEventRequest

type DeleteEventRequest struct {
	EventID snowflake.ID `param:"event_id"`
}

DeleteEventRequest is a request to delete an event.

type DeleteUserRequest

type DeleteUserRequest struct {
	UserID snowflake.ID `form:"user_id"`
}

DeleteUserRequest is a request to delete a user.

type EditEventForm

type EditEventForm struct {
	EventID        snowflake.ID `param:"event_id"`
	IsDraft        bool         `query:"draft"`
	Title          string       `form:"title"`
	Description    string       `form:"desc"`
	URL            string       `form:"url"`
	StartAt        string       `form:"start_at"`
	Location       string       `form:"location"`
	Latitude       float64      `form:"latitude"`
	Longitude      float64      `form:"longitude"`
	TimezoneOffset int          `form:"timezone_offset"`
	UserTimezone   string       `form:"user_timezone"`
}

EditEventForm is an edit event form.

func (*EditEventForm) IsDraftOrNew

func (r *EditEventForm) IsDraftOrNew() bool

IsDraftOrNew reports whether the current event is draft or a new event.

func (*EditEventForm) Validate

func (r *EditEventForm) Validate() url.Values

Validate the form.

type EditStopWordsForm

type EditStopWordsForm struct {
	Words string `form:"words"`
}

EditStopWordsForm is the edit stop words form.

type ListEventsRequest

type ListEventsRequest struct {
	Offset int64  `form:"offset"`
	LastID int64  `form:"last_id"`
	Search string `form:"search"`
}

ListEventsRequest is a request to list events.

type LoginForm

type LoginForm struct {
	Username string `form:"username"`
	Password string `form:"password"`
}

LoginForm is a login form.

func (*LoginForm) Validate

func (f *LoginForm) Validate() url.Values

Validate the form.

type RegisterForm

type RegisterForm struct {
	Username  string `form:"username"`
	Password1 string `form:"password1"`
	Password2 string `form:"password2"`
}

RegisterForm is the register form.

func (*RegisterForm) Validate

func (f *RegisterForm) Validate() url.Values

Validate the form.

type RegisterRequest

type RegisterRequest struct {
	Token uuid.UUID `param:"token"`
}

RegisterRequest is a request to render the register page.

type SetupForm

type SetupForm struct {
	Title       string `form:"pagetitle"`
	Description string `form:"pagedesc"`
	Username    string `form:"username"`
	Password1   string `form:"password1"`
	Password2   string `form:"password2"`
}

SetupForm is a setup form.

func (*SetupForm) Validate

func (f *SetupForm) Validate() url.Values

Validate the form.

Jump to

Keyboard shortcuts

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