Documentation ¶
Index ¶
- 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 QueryResolver
- type ResolverRoot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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 { Serial func(childComplexity int) int Labels func(childComplexity int) int Rack func(childComplexity int) int IndexInRack func(childComplexity int) int Role func(childComplexity int) int Ipv4 func(childComplexity int) int RegisterDate func(childComplexity int) int RetireDate func(childComplexity int) int Bmc func(childComplexity int) int } MachineStatus struct { State func(childComplexity int) int Timestamp func(childComplexity int) int Duration 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 { Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type DirectiveRoot ¶
type DirectiveRoot struct { }
type LabelInput ¶
LabelInput represents a label to search machines.
func UnmarshalLabelInput ¶
func UnmarshalLabelInput(v interface{}) (LabelInput, error)
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"` Racks []int `json:"racks"` Roles []string `json:"roles"` States []MachineState `json:"states"` MinDaysBeforeRetire *int `json:"minDaysBeforeRetire"` }
MachineParams is a set of input parameters to search machines.
func UnmarshalMachineParams ¶
func UnmarshalMachineParams(v interface{}) (MachineParams, error)
type MachineSpec ¶
type MachineSpec struct { Serial string `json:"serial"` Labels []Label `json:"labels"` 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.