graphql

package
v0.0.0-...-80a9f4b Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2017 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GraphiQL = []byte(`
<!DOCTYPE html>
<html>
	<head>
		<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/graphiql/0.10.2/graphiql.css" />
		<script src="https://cdnjs.cloudflare.com/ajax/libs/fetch/1.1.0/fetch.min.js"></script>
		<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.5.4/react.min.js"></script>
		<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.5.4/react-dom.min.js"></script>
		<script src="https://cdnjs.cloudflare.com/ajax/libs/graphiql/0.10.2/graphiql.js"></script>
	</head>
	<body style="width: 100%; height: 100%; margin: 0; overflow: hidden;">
		<div id="graphiql" style="height: 100vh;">Loading...</div>
		<script>
			function graphQLFetcher(graphQLParams) {
				return fetch("/graphql", {
					method: "post",
					body: JSON.stringify(graphQLParams),
					credentials: "include",
				}).then(function (response) {
					return response.text();
				}).then(function (responseBody) {
					try {
						return JSON.parse(responseBody);
					} catch (error) {
						return responseBody;
					}
				});
			}
			ReactDOM.render(
				React.createElement(GraphiQL, {fetcher: graphQLFetcher}),
				document.getElementById("graphiql")
			);
		</script>
	</body>
</html>
`)

GraphiQL dev tool

View Source
var Schema = `` /* 1433-byte string literal not displayed */

Schema defiens the evehub graphql schema

Functions

This section is empty.

Types

type Blueprint

type Blueprint struct {
	TypeID   int32
	TypeName string
	Quantity int32
	Volume   float64
	Runs     int32
	Te       float64
	Me       float64
}

type BlueprintResolver

type BlueprintResolver struct {
	B *Blueprint
}

func (*BlueprintResolver) Me

func (r *BlueprintResolver) Me() float64

func (*BlueprintResolver) Quantity

func (r *BlueprintResolver) Quantity() int32

func (*BlueprintResolver) Runs

func (r *BlueprintResolver) Runs() int32

func (*BlueprintResolver) Te

func (r *BlueprintResolver) Te() float64

func (*BlueprintResolver) TypeID

func (r *BlueprintResolver) TypeID() int32

func (*BlueprintResolver) TypeName

func (r *BlueprintResolver) TypeName() string

func (*BlueprintResolver) Volume

func (r *BlueprintResolver) Volume() float64

type IndustryInput

type IndustryInput struct {
	ActivityID        int32
	Runs              int32
	Jobs              int32
	BlueprintTypeID   int32
	BlueprintTypeName string
	BlueprintRuns     int32
	BlueprintTe       float64
	BlueprintMe       float64
	FacilityTe        float64
	FacilityMe        float64
	Industry          float64
	AdvancedIndustry  float64
	Implant           float64
}

type Item

type Item interface {
	TypeID() int32
	TypeName() string
	Quantity() int32
	Volume() float64
}

type ItemResolver

type ItemResolver struct {
	Item
}

func (*ItemResolver) Me

func (r *ItemResolver) Me() float64

func (*ItemResolver) Runs

func (r *ItemResolver) Runs() int32

func (*ItemResolver) Te

func (r *ItemResolver) Te() float64

func (*ItemResolver) ToBlueprint

func (r *ItemResolver) ToBlueprint() (*BlueprintResolver, bool)

func (*ItemResolver) ToMaterial

func (r *ItemResolver) ToMaterial() (*MaterialResolver, bool)

type Job

type Job struct {
	Runs       int32
	ActivityID int32
	Time       float64
	Blueprint  *ItemResolver
	Materials  *[]*ItemResolver
	Output     *ItemResolver
}

type JobResolver

type JobResolver struct {
	J          *Job
	AppContext *appContext.AppContext
}

func (*JobResolver) ActivityID

func (r *JobResolver) ActivityID() int32

func (*JobResolver) Blueprint

func (r *JobResolver) Blueprint() *ItemResolver

func (*JobResolver) Materials

func (r *JobResolver) Materials() *[]*ItemResolver

func (*JobResolver) Output

func (r *JobResolver) Output() *ItemResolver

func (*JobResolver) Runs

func (r *JobResolver) Runs() int32

func (*JobResolver) Time

func (r *JobResolver) Time() float64

type Line

type Line struct {
	Jobs      *[]*JobResolver
	Time      float64
	Materials *[]*ItemResolver
	Outputs   *[]*ItemResolver
}

type LineResolver

type LineResolver struct {
	L *Line
}

func (*LineResolver) AddJob

func (r *LineResolver) AddJob(job *JobResolver)

func (*LineResolver) Jobs

func (r *LineResolver) Jobs() *[]*JobResolver

func (*LineResolver) Materials

func (r *LineResolver) Materials() *[]*ItemResolver

func (*LineResolver) Outputs

func (r *LineResolver) Outputs() *[]*ItemResolver

func (*LineResolver) Time

func (r *LineResolver) Time() float64

type Material

type Material struct {
	TypeID   int32
	TypeName string
	Quantity int32
	Volume   float64
}

type MaterialResolver

type MaterialResolver struct {
	M *Material
}

func (*MaterialResolver) Quantity

func (r *MaterialResolver) Quantity() int32

func (*MaterialResolver) TypeID

func (r *MaterialResolver) TypeID() int32

func (*MaterialResolver) TypeName

func (r *MaterialResolver) TypeName() string

func (*MaterialResolver) Volume

func (r *MaterialResolver) Volume() float64

type Planet

type Planet struct {
	PlanetId int32
	Moons    *[]int32
}

type PlanetResolver

type PlanetResolver struct {
	P *Planet
}

func (*PlanetResolver) Moons

func (r *PlanetResolver) Moons() *[]int32

func (*PlanetResolver) PlanetId

func (r *PlanetResolver) PlanetId() int32

type Region

type Region struct {
	Id       string `bson:"_id",omitempty`
	RegionId int32
}

type RegionResolver

type RegionResolver struct {
	R *Region
}

func (*RegionResolver) Id

func (r *RegionResolver) Id() string

func (*RegionResolver) RegionId

func (r *RegionResolver) RegionId() int32

func (*RegionResolver) Store

func (r *RegionResolver) Store(appContext appContext.AppContext) error

type Resolver

type Resolver struct {
	AppContext *appContext.AppContext
}

Resolver is a struct thats used by graphql-go to access resolver functions

func (*Resolver) Blueprints

func (r *Resolver) Blueprints() (*[]*ItemResolver, error)

func (*Resolver) Industry

func (r *Resolver) Industry(args struct {
	Input           []*IndustryInput
	ProductionLines int32
	InventionLines  int32
}) (*ScheduleResolver, error)

func (*Resolver) Systems

func (r *Resolver) Systems() (*[]*SystemResolver, error)

type Schedule

type Schedule struct {
	ProductionLines *[]*LineResolver
	InventionLines  *[]*LineResolver
}

type ScheduleResolver

type ScheduleResolver struct {
	S *Schedule
}

func (*ScheduleResolver) InventionLines

func (r *ScheduleResolver) InventionLines() *[]*LineResolver

func (*ScheduleResolver) ProductionLines

func (r *ScheduleResolver) ProductionLines() *[]*LineResolver

func (*ScheduleResolver) ShortestInventionLine

func (r *ScheduleResolver) ShortestInventionLine() *LineResolver

func (*ScheduleResolver) ShortestProductionLine

func (r *ScheduleResolver) ShortestProductionLine() *LineResolver

type System

type System struct {
	Id              string `bson:"_id",omitempty`
	StarId          int32
	SystemId        int32
	Name            string
	PositionX       float64
	PositionY       float64
	PositionZ       float64
	SecurityStatus  float64
	ConstellationId int32
	Planets         *[]*PlanetResolver
	SecurityClass   string
	Stargates       *[]int32
	Stations        *[]int32
}

type SystemResolver

type SystemResolver struct {
	S *System
}

func (*SystemResolver) ConstellationId

func (r *SystemResolver) ConstellationId() int32

func (*SystemResolver) Id

func (r *SystemResolver) Id() string

func (*SystemResolver) Name

func (r *SystemResolver) Name() string

func (*SystemResolver) Planets

func (r *SystemResolver) Planets() *[]*PlanetResolver

func (*SystemResolver) PositionX

func (r *SystemResolver) PositionX() float64

func (*SystemResolver) PositionY

func (r *SystemResolver) PositionY() float64

func (*SystemResolver) PositionZ

func (r *SystemResolver) PositionZ() float64

func (*SystemResolver) SecurityClass

func (r *SystemResolver) SecurityClass() string

func (*SystemResolver) SecurityStatus

func (r *SystemResolver) SecurityStatus() float64

func (*SystemResolver) StarId

func (r *SystemResolver) StarId() int32

func (*SystemResolver) Stargates

func (r *SystemResolver) Stargates() *[]int32

func (*SystemResolver) Stations

func (r *SystemResolver) Stations() *[]int32

func (*SystemResolver) Store

func (r *SystemResolver) Store(appContext appContext.AppContext) error

func (*SystemResolver) SystemId

func (r *SystemResolver) SystemId() int32

Jump to

Keyboard shortcuts

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