starwars

package
v0.0.0-...-5ccb520 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AWing = &Ship{"3", "A-Wing"}
View Source
var Empire = &Faction{
	"2",
	"Galactic Empire",
	[]string{"6", "7", "8"},
}
View Source
var Executor = &Ship{"8", "Executor"}
View Source
var Falcon = &Ship{"4", "Millenium Falcon"}

Yeah, technically it's Corellian. But it flew in the service of the rebels, so for the purposes of this demo it's a rebel ship.

View Source
var HomeOne = &Ship{"5", "Home One"}
View Source
var Rebels = &Faction{
	"1",
	"Alliance to Restore the Republic",
	[]string{"1", "2", "3", "4", "5"},
}

exported schema, defined in init()

View Source
var TIEFighter = &Ship{"6", "TIE Fighter"}
View Source
var TIEInterceptor = &Ship{"7", "TIE Interceptor"}
View Source
var XWing = &Ship{"1", "X-Wing"}
View Source
var YWing = &Ship{"2", "Y-Wing"}

Functions

This section is empty.

Types

type Faction

type Faction struct {
	ID    string   `json:"id"`
	Name  string   `json:"name"`
	Ships []string `json:"ships"`
}

func GetEmpire

func GetEmpire() *Faction

func GetFaction

func GetFaction(id string) *Faction

func GetRebels

func GetRebels() *Faction

type Ship

type Ship struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

func CreateShip

func CreateShip(shipName string, factionId string) *Ship

func GetShip

func GetShip(id string) *Ship

Jump to

Keyboard shortcuts

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