controllers

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 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

	NS *websocket.NSConn
}

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) Post

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

Post handles the POST: /todos route.

func (*TodoController) Save

func (c *TodoController) Save(msg websocket.Message) error

Jump to

Keyboard shortcuts

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