backfire

package
v0.0.0-...-8006d37 Latest Latest
Warning

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

Go to latest
Published: May 27, 2014 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackfireServer

type BackfireServer struct {
	Host     string
	Port     int
	Database *Db
}

func MakeServer

func MakeServer(
	host string,
	port int,
	db_host string,
	db_port int,
	db_name string,
) *BackfireServer

func (*BackfireServer) GetMapByAuthorName

func (bfs *BackfireServer) GetMapByAuthorName(
	w rest.ResponseWriter,
	req *rest.Request,
)

func (*BackfireServer) GetMapByName

func (bfs *BackfireServer) GetMapByName(
	w rest.ResponseWriter,
	req *rest.Request,
)

func (*BackfireServer) PostMap

func (bfs *BackfireServer) PostMap(
	w rest.ResponseWriter,
	req *rest.Request,
)

func (*BackfireServer) Start

func (bfs *BackfireServer) Start()

type Configuration

type Configuration struct {
	Initial map[string]int `json:"initial"`
	Goal    map[string]int `json:"goal"`
}

type Db

type Db struct {
	Host string
	Port int
	Name string
}

func MakeDb

func MakeDb(host string, port int, name string) *Db

func (*Db) Connect

func (db *Db) Connect() (*r.Session, error)

func (*Db) Create

func (db *Db) Create() error

func (*Db) GetByAuthorName

func (db *Db) GetByAuthorName(name string) ([]Map, error)

func (*Db) GetByName

func (db *Db) GetByName(name string) (*Map, error)

func (*Db) GetTable

func (db *Db) GetTable(table_name string) r.Exp

func (*Db) Init

func (db *Db) Init() (bool, error)

func (*Db) Insert

func (db *Db) Insert(cmap Map) (*r.WriteResponse, error)

type ErrorMessage

type ErrorMessage struct {
	Err  string `json:"error"`
	Code int    `json:"code"`
}

type Map

type Map struct {
	Name           string          `json:"name"`
	AuthorName     string          `json:"authorName"`
	AuthorEmail    string          `json:"authorEmail"`
	Width          int             `json:"width"`
	Height         int             `json:"height"`
	Depth          int             `json:"depth"`
	Configurations []Configuration `json:"configurations"`
	Obstacles      []Obstacle      `json:"obstacles"`
}

type Obstacle

type Obstacle struct {
	Dynamic  bool    `json:"dynamic"`
	Name     string  `json:"name"`
	Vertices []Point `json:"vertices"`
}

type Point

type Point struct {
	X int `json:"x"`
	Y int `json:"y"`
	Z int `json:"z"`
}

Jump to

Keyboard shortcuts

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