server

package
v0.0.0-...-4688aa9 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2016 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIServer

type APIServer struct {
	Dependencies
	Port int32
}

APIServer implements the API serving part of mtgbrew

func (*APIServer) Serve

func (s *APIServer) Serve() error

Serve sets up and starts the server

type CardEntry

type CardEntry struct {
	Card  *mtgjson.Card
	Count int
}

CardEntry represents the name and count of a particular card in the list

func (CardEntry) String

func (c CardEntry) String() string

type DeckList

type DeckList map[string]*CardEntry

DeckList represents a set of cards

func (DeckList) AddCard

func (d DeckList) AddCard(card *mtgjson.Card, count int) error

AddCard adds a card to the deck up to a max of 4 except for basic lands

func (DeckList) String

func (d DeckList) String() string

func (DeckList) TCGList

func (d DeckList) TCGList() string

TCGList formats Deck for TCGPlayer mass input 4 Mountain||4 Forest||...etc

type Dependencies

type Dependencies struct {
	DBH *db.Handle
}

Dependencies contains all of the things the server needs to run

type Template

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

Template implements the template functionality needed for Echo

func (*Template) Render

func (t *Template) Render(w io.Writer, name string, data interface{}, c echo.Context) error

Render implements the echo Render interface

Jump to

Keyboard shortcuts

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