mirror of https://github.com/status-im/consul.git
61 lines
2.1 KiB
Go
61 lines
2.1 KiB
Go
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
package api
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// ResourceReference is a reference to a ConfigEntry
|
|
// with an optional reference to a subsection of that ConfigEntry
|
|
// that can be specified as SectionName
|
|
type ResourceReference struct {
|
|
// Kind is the kind of ConfigEntry that this resource refers to.
|
|
Kind string
|
|
// Name is the identifier for the ConfigEntry this resource refers to.
|
|
Name string
|
|
// SectionName is a generic subresource identifier that specifies
|
|
// a subset of the ConfigEntry to which this reference applies. Usage
|
|
// of this field should be up to the controller that leverages it. If
|
|
// unused, this should be blank.
|
|
SectionName string
|
|
|
|
// Partition is the partition the config entry is associated with.
|
|
// Partitioning is a Consul Enterprise feature.
|
|
Partition string `json:",omitempty"`
|
|
|
|
// Namespace is the namespace the config entry is associated with.
|
|
// Namespacing is a Consul Enterprise feature.
|
|
Namespace string `json:",omitempty"`
|
|
}
|
|
|
|
// ConfigEntryStatus is used for propagating back asynchronously calculated
|
|
// messages from control loops to a user
|
|
type ConfigEntryStatus struct {
|
|
// Conditions is the set of condition objects associated with
|
|
// a ConfigEntry status.
|
|
Conditions []Condition
|
|
}
|
|
|
|
// Condition is used for a single message and state associated
|
|
// with an object. For example, a ConfigEntry that references
|
|
// multiple other resources may have different statuses with
|
|
// respect to each of those resources.
|
|
type Condition struct {
|
|
// Type is a value from a bounded set of types that an object might have
|
|
Type string
|
|
// Status is a value from a bounded set of statuses that an object might have
|
|
Status string
|
|
// Reason is a value from a bounded set of reasons for a given status
|
|
Reason string
|
|
// Message is a message that gives more detailed information about
|
|
// why a Condition has a given status and reason
|
|
Message string
|
|
// Resource is an optional reference to a resource for which this
|
|
// condition applies
|
|
Resource *ResourceReference
|
|
// LastTransitionTime is the time at which this Condition was created
|
|
LastTransitionTime *time.Time
|
|
}
|