datastores

package
v0.0.0-...-b3dc69a Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHero

func GetHero(episode interface{}) interface{}

GetHero helper function

Types

type MySQLDB

type MySQLDB struct {
	Protocol string
	Address  string
	Database string
	User     string
	Password string
}

MySQLDB is the database information

func (MySQLDB) GetFriends

func (store MySQLDB) GetFriends(humanID int) ([]StarWarsChar, error)

GetFriends gets the friends of the passed humanID

func (MySQLDB) GetHuman

func (store MySQLDB) GetHuman(humanID int) (StarWarsChar, error)

GetHuman gets the human with the given id from the database

type StarWarsChar

type StarWarsChar struct {
	ID              string
	Name            string
	Friends         []StarWarsChar
	AppearsIn       []int
	HomePlanet      string
	PrimaryFunction string
}

StarWarsChar struct

var (
	Luke           StarWarsChar
	Vader          StarWarsChar
	Han            StarWarsChar
	Leia           StarWarsChar
	Tarkin         StarWarsChar
	Threepio       StarWarsChar
	Artoo          StarWarsChar
	HumanData      map[int]StarWarsChar
	DroidData      map[int]StarWarsChar
	StarWarsSchema graphql.Schema
)

Our package variables

func GetDroid

func GetDroid(id int) StarWarsChar

GetDroid helper function

Jump to

Keyboard shortcuts

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