controllers

package
v0.0.0-...-a03367d Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostItemResponse

type PostItemResponse struct {
	Success bool `json:"success"`
}

PostItemResponse the response data that will be returned as json after a post save action of all todo items.

type TodoController

type TodoController struct {
	Service todo.Service

	Session *sessions.Session
}

TodoController is our TODO app's web controller.

func (*TodoController) BeforeActivation

func (c *TodoController) BeforeActivation(b mvc.BeforeActivation)

BeforeActivation called once before the server ran, and before the routes and dependencies binded. You can bind custom things to the controller, add new methods, add middleware, add dependencies to the struct or the method(s) and more.

func (*TodoController) Get

func (c *TodoController) Get() []todo.Item

Get handles the GET: /todos route.

func (*TodoController) GetSync

func (c *TodoController) GetSync(conn websocket.Connection)

func (*TodoController) Post

func (c *TodoController) Post(newItems []todo.Item) PostItemResponse

Post handles the POST: /todos route.

Jump to

Keyboard shortcuts

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