luci: go.chromium.org/luci/machine-db/api/common/v1 Index | Files

package common

import "go.chromium.org/luci/machine-db/api/common/v1"

Index

Package Files

generate.go prefixes.go states.pb.go

Variables

var State_name = map[int32]string{
    0:  "STATE_UNSPECIFIED",
    1:  "FREE",
    2:  "PRERELEASE",
    3:  "SERVING",
    4:  "TEST",
    5:  "REPAIR",
    6:  "DECOMMISSIONED",
}
var State_value = map[string]int32{
    "STATE_UNSPECIFIED": 0,
    "FREE":              1,
    "PRERELEASE":        2,
    "SERVING":           3,
    "TEST":              4,
    "REPAIR":            5,
    "DECOMMISSIONED":    6,
}

type State Uses

type State int32

State is an enumeration of possible states a resource may be in. When adding a state here, choose a name that results in no common prefixes between any two states, then update prefix-matching in prefixes.go.

const (
    // Resource state unspecified.
    State_STATE_UNSPECIFIED State = 0
    // Resource is not allocated.
    State_FREE State = 1
    // Resource is allocated for future use.
    State_PRERELEASE State = 2
    // Resource is allocated and currently used in production.
    State_SERVING State = 3
    // Resource is allocated and currently used for testing.
    State_TEST State = 4
    // Resource is undergoing repairs.
    State_REPAIR State = 5
    // Resource is allocated but unused.
    State_DECOMMISSIONED State = 6
)

func GetState Uses

func GetState(s string) (State, error)

GetState returns a State given its name. Supports prefix matching.

func ValidStates Uses

func ValidStates() []State

ValidStates returns a slice of valid states.

func (State) EnumDescriptor Uses

func (State) EnumDescriptor() ([]byte, []int)

func (State) Name Uses

func (s State) Name() string

Name returns a string which can be used as the human-readable representation expected by GetState.

func (State) String Uses

func (x State) String() string

Package common imports 5 packages (graph) and is imported by 2 packages. Updated 2018-10-19. Refresh now. Tools for package owners.