model

package
v3.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrInvalidStateName is an error code when state name is invalid.
	ErrInvalidStateName = "INVALID_STATE_NAME"

	// ErrInvalidStateTransition is an error code when state transition is invalid.
	ErrInvalidStateTransition = "INVALID_STATE_TRANSITION"

	// ErrEncryptionKeyExists is an error code when a retiring machine to retired that still has disk encryption keys.
	ErrEncryptionKeyExists = "ENCRYPTION_KEY_EXISTS"

	// ErrMachineNotFound is an error code when no specified machine found.
	ErrMachineNotFound = "MACHINE_NOT_FOUND"

	// ErrInternalServerError is an error code when internal server error has occurred.
	ErrInternalServerError = "INTERNAL_SERVER_ERROR"
)

Variables

This section is empty.

Functions

func MarshalMachineState

func MarshalMachineState(state sabakan.MachineState) graphql.Marshaler

MarshalMachineState helps mapping sabakan.MachineState with GraphQL enum.

func UnmarshalMachineState

func UnmarshalMachineState(v interface{}) (sabakan.MachineState, error)

UnmarshalMachineState helps mapping sabakan.MachineState with GraphQL enum.

Types

type DateTime

type DateTime time.Time

DateTime represents "DateTime" GraphQL custom scalar.

func (DateTime) MarshalGQL

func (dt DateTime) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (*DateTime) UnmarshalGQL

func (dt *DateTime) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Marshaler interface.

type IPAddress

type IPAddress struct {
	net.IP
}

IPAddress represents "IPAddress" GraphQL custom scalar.

func (IPAddress) MarshalGQL

func (a IPAddress) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (*IPAddress) UnmarshalGQL

func (a *IPAddress) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Marshaler interface.

type Label

type Label struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

Label represents an arbitrary key-value pairs.

type LabelInput

type LabelInput struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

LabelInput represents a label to search machines.

type MachineParams

type MachineParams struct {
	Labels              []*LabelInput          `json:"labels,omitempty"`
	Racks               []int                  `json:"racks,omitempty"`
	Roles               []string               `json:"roles,omitempty"`
	States              []sabakan.MachineState `json:"states,omitempty"`
	MinDaysBeforeRetire *int                   `json:"minDaysBeforeRetire,omitempty"`
}

MachineParams is a set of input parameters to search machines.

Jump to

Keyboard shortcuts

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