api

package
v0.0.0-...-7df1e21 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API object

func NewAPI

func NewAPI(db *gorm.DB, config *config.Config) *API

NewAPI with routes

func (*API) ListenAndServe

func (api *API) ListenAndServe(ctx context.Context, addr string) error

ListenAndServe api server

func (*API) Shutdown

func (api *API) Shutdown(ctx context.Context)

Shutdown will shut down the API and its http server gracefully

type EventRequest

type EventRequest struct {
	Title       string `json:"title" validate:"required,min=5,max=200"`
	Description string `json:"description" validate:"omitempty,max=200"`

	ImageURL string `json:"image_url" validate:"omitempty,url"`

	EventStart    string `json:"event_start" validate:"required"`
	WithStartTime bool   `json:"with_starttime"  validate:"-"`

	Platform string `json:"platform" validate:"omitempty,max=40"`
	URL      string `json:"url" validate:"omitempty,url"`

	Category string `json:"category" validate:"omitempty,max=40"`
}

Jump to

Keyboard shortcuts

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