Documentation ¶
Index ¶
- func MarshalMachineState(state sabakan.MachineState) graphql.Marshaler
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- func UnmarshalMachineState(v interface{}) (sabakan.MachineState, error)
- type BMCResolver
- type ComplexityRoot
- type Config
- type DateTime
- type DirectiveRoot
- type IPAddress
- type Label
- type LabelInput
- type MachineParams
- type MachineSpecResolver
- type MachineStatusResolver
- type NICConfigResolver
- type QueryResolver
- type Resolver
- type ResolverRoot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalMachineState ¶
func MarshalMachineState(state sabakan.MachineState) graphql.Marshaler
MarshalMachineState helps mapping sabakan.MachineState with GraphQL enum.
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
func UnmarshalMachineState ¶
func UnmarshalMachineState(v interface{}) (sabakan.MachineState, error)
UnmarshalMachineState helps mapping sabakan.MachineState with GraphQL enum.
Types ¶
type BMCResolver ¶
type ComplexityRoot ¶
type ComplexityRoot struct { Bmc struct { BmcType func(childComplexity int) int Ipv4 func(childComplexity int) int } Bmcinfo struct { 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 Info func(childComplexity int) int } MachineInfo struct { Network func(childComplexity int) int Bmc 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 } Nicconfig struct { Address func(childComplexity int) int Netmask func(childComplexity int) int Maskbits func(childComplexity int) int Gateway func(childComplexity int) int } NetworkInfo struct { Ipv4 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 DateTime ¶
DateTime represents "DateTime" GraphQL custom scalar.
func (DateTime) MarshalGQL ¶
MarshalGQL implements graphql.Marshaler interface.
func (*DateTime) UnmarshalGQL ¶
UnmarshalGQL implements graphql.Marshaler interface.
type DirectiveRoot ¶
type DirectiveRoot struct { }
type IPAddress ¶
IPAddress represents "IPAddress" GraphQL custom scalar.
func (IPAddress) MarshalGQL ¶
MarshalGQL implements graphql.Marshaler interface.
func (*IPAddress) UnmarshalGQL ¶
UnmarshalGQL implements graphql.Marshaler interface.
type LabelInput ¶
LabelInput represents a label to search machines.
func UnmarshalLabelInput ¶
func UnmarshalLabelInput(v interface{}) (LabelInput, error)
type MachineParams ¶
type MachineParams struct { Labels []LabelInput `json:"labels"` Racks []int `json:"racks"` Roles []string `json:"roles"` States []sabakan.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 MachineSpecResolver ¶
type MachineSpecResolver interface { Labels(ctx context.Context, obj *sabakan.MachineSpec) ([]Label, error) Rack(ctx context.Context, obj *sabakan.MachineSpec) (int, error) IndexInRack(ctx context.Context, obj *sabakan.MachineSpec) (int, error) Ipv4(ctx context.Context, obj *sabakan.MachineSpec) ([]IPAddress, error) RegisterDate(ctx context.Context, obj *sabakan.MachineSpec) (DateTime, error) RetireDate(ctx context.Context, obj *sabakan.MachineSpec) (DateTime, error) }
type MachineStatusResolver ¶
type NICConfigResolver ¶ added in v1.2.0
type QueryResolver ¶
type Resolver ¶
Resolver implements ResolverRoot.
func (*Resolver) MachineSpec ¶
func (r *Resolver) MachineSpec() MachineSpecResolver
MachineSpec implements ResolverRoot.
func (*Resolver) MachineStatus ¶
func (r *Resolver) MachineStatus() MachineStatusResolver
MachineStatus implements ResolverRoot.
func (*Resolver) NICConfig ¶ added in v1.2.0
func (r *Resolver) NICConfig() NICConfigResolver
NICConfig implements ResolverRoot.
type ResolverRoot ¶
type ResolverRoot interface { BMC() BMCResolver MachineSpec() MachineSpecResolver MachineStatus() MachineStatusResolver NICConfig() NICConfigResolver Query() QueryResolver }