mirror of https://github.com/hashicorp/consul
52 lines
1.7 KiB
Go
52 lines
1.7 KiB
Go
|
package structs
|
||
|
|
||
|
import (
|
||
|
"time"
|
||
|
|
||
|
"github.com/hashicorp/consul/acl"
|
||
|
)
|
||
|
|
||
|
// 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
|
||
|
|
||
|
acl.EnterpriseMeta
|
||
|
}
|
||
|
|
||
|
// Status is used for propagating back asynchronously calculated
|
||
|
// messages from control loops to a user
|
||
|
type Status 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 {
|
||
|
// 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
|
||
|
}
|