Documentation ¶
Index ¶
- Variables
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- func Server() *httptest.Server
- type Bmc
- type ComplexityRoot
- type Config
- type DirectiveRoot
- type Label
- type LabelInput
- type Machine
- type MachineParams
- type MachineSpec
- type MachineState
- type MachineStatus
- type Query
- type QueryResolver
- type ResolverRoot
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
Types ¶
type ComplexityRoot ¶
type ComplexityRoot struct { BMC struct { BmcType func(childComplexity int) int Ipv4 func(childComplexity int) int } Label struct { Name func(childComplexity int) int Value func(childComplexity int) int } Machine struct { Spec func(childComplexity int) int Status func(childComplexity int) int } MachineSpec struct { Bmc func(childComplexity int) int IndexInRack func(childComplexity int) int Ipv4 func(childComplexity int) int Labels func(childComplexity int) int Rack func(childComplexity int) int RegisterDate func(childComplexity int) int RetireDate func(childComplexity int) int Role func(childComplexity int) int Serial func(childComplexity int) int } MachineStatus struct { Duration func(childComplexity int) int State func(childComplexity int) int Timestamp func(childComplexity int) int } Query struct { Machine func(childComplexity int, serial string) int SearchMachines func(childComplexity int, having *MachineParams, notHaving *MachineParams) int } }
type Config ¶
type Config struct { Schema *ast.Schema Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type DirectiveRoot ¶
type DirectiveRoot struct { }
type LabelInput ¶
LabelInput represents a label to search machines.
type Machine ¶
type Machine struct { Spec *MachineSpec `json:"spec"` Status *MachineStatus `json:"status"` }
Machine represents a physical server in a datacenter rack.
type MachineParams ¶
type MachineParams struct { Labels []*LabelInput `json:"labels,omitempty"` Racks []int `json:"racks,omitempty"` Roles []string `json:"roles,omitempty"` States []MachineState `json:"states,omitempty"` MinDaysBeforeRetire *int `json:"minDaysBeforeRetire,omitempty"` }
MachineParams is a set of input parameters to search machines.
type MachineSpec ¶
type MachineSpec struct { Serial string `json:"serial"` Labels []*Label `json:"labels,omitempty"` Rack int `json:"rack"` IndexInRack int `json:"indexInRack"` Role string `json:"role"` Ipv4 []string `json:"ipv4"` RegisterDate string `json:"registerDate"` RetireDate string `json:"retireDate"` Bmc *Bmc `json:"bmc"` }
MachineSpec represents specifications of a machine.
type MachineState ¶
type MachineState string
MachineState enumerates machine states.
const ( MachineStateUninitialized MachineState = "UNINITIALIZED" MachineStateHealthy MachineState = "HEALTHY" MachineStateUnhealthy MachineState = "UNHEALTHY" MachineStateUnreachable MachineState = "UNREACHABLE" MachineStateUpdating MachineState = "UPDATING" MachineStateRetiring MachineState = "RETIRING" MachineStateRetired MachineState = "RETIRED" )
func (MachineState) IsValid ¶
func (e MachineState) IsValid() bool
func (MachineState) MarshalGQL ¶
func (e MachineState) MarshalGQL(w io.Writer)
func (MachineState) String ¶
func (e MachineState) String() string
func (*MachineState) UnmarshalGQL ¶
func (e *MachineState) UnmarshalGQL(v interface{}) error
type MachineStatus ¶
type MachineStatus struct { State MachineState `json:"state"` Timestamp string `json:"timestamp"` Duration float64 `json:"duration"` }
MachineStatus represents status of a Machine.
type QueryResolver ¶
type ResolverRoot ¶
type ResolverRoot interface {
Query() QueryResolver
}
Click to show internal directories.
Click to hide internal directories.