controllers

package
v0.0.0-...-73d33f3 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decks

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

func NewDecks

func NewDecks(ds models.DeckService) *Decks

func (*Decks) Create

func (d *Decks) Create(w http.ResponseWriter, r *http.Request)

Create is used to create deck resource replies the request with created deck resource info and HTTP 201 code if succeed

POST /deck

func (*Decks) Draw

func (d *Decks) Draw(w http.ResponseWriter, r *http.Request)

Draw used to draw cards from deck resource Replies the request with drawn card resources and HTTP 200

POST /deck/:uid/draw

func (*Decks) Open

func (d *Decks) Open(w http.ResponseWriter, r *http.Request)

Open is used the open deck Replies the request with deck resource with cards and HTTP 200 if succeed

PUT /draw/:uid/open

type Server

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

func NewServer

func NewServer(dc *Decks) *Server

NewServer returns new server instance

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP dispatches the handler registered in the matched route.

Jump to

Keyboard shortcuts

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