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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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