Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type K8sResource ¶
type K8sResource = kinds.GrafanaResource[Spec, Status]
Resource is the kubernetes style representation of PublicDashboard. (TODO be better)
func NewK8sResource ¶
func NewK8sResource(name string, s *Spec) K8sResource
NewResource creates a new instance of the resource with a given name (UID)
type KubeObjectMetadata ¶
type KubeObjectMetadata struct { CreationTimestamp time.Time `json:"creationTimestamp"` DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"` Finalizers []string `json:"finalizers"` Labels map[string]string `json:"labels"` ResourceVersion string `json:"resourceVersion"` Uid string `json:"uid"` }
_kubeObjectMetadata is metadata found in a kubernetes object's metadata field. It is not exhaustive and only includes fields which may be relevant to a kind's implementation, As it is also intended to be generic enough to function with any API Server.
type Metadata ¶
type Metadata struct { CreatedBy string `json:"createdBy"` CreationTimestamp time.Time `json:"creationTimestamp"` DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"` // extraFields is reserved for any fields that are pulled from the API server metadata but do not have concrete fields in the CUE metadata ExtraFields map[string]any `json:"extraFields"` Finalizers []string `json:"finalizers"` Labels map[string]string `json:"labels"` ResourceVersion string `json:"resourceVersion"` Uid string `json:"uid"` UpdateTimestamp time.Time `json:"updateTimestamp"` UpdatedBy string `json:"updatedBy"` }
Metadata defines model for Metadata.
type OperatorState ¶
type OperatorState struct { // descriptiveState is an optional more descriptive state field which has no requirements on format DescriptiveState *string `json:"descriptiveState,omitempty"` // details contains any extra information that is operator-specific Details map[string]any `json:"details,omitempty"` // lastEvaluation is the ResourceVersion last evaluated LastEvaluation string `json:"lastEvaluation"` // state describes the state of the lastEvaluation. // It is limited to three possible states for machine evaluation. State OperatorStateState `json:"state"` }
OperatorState defines model for OperatorState.
type OperatorStateState ¶
type OperatorStateState string
OperatorStateState state describes the state of the lastEvaluation. It is limited to three possible states for machine evaluation.
const ( OperatorStateStateFailed OperatorStateState = "failed" OperatorStateStateInProgress OperatorStateState = "in_progress" OperatorStateStateSuccess OperatorStateState = "success" )
Defines values for OperatorStateState.
type Resource ¶
type Resource struct { Metadata Metadata `json:"metadata"` Spec Spec `json:"spec"` Status Status `json:"status"` }
Resource is the wire representation of PublicDashboard. It currently will soon be merged into the k8s flavor (TODO be better)
type Spec ¶
type Spec struct { // Unique public access token AccessToken *string `json:"accessToken,omitempty"` // Flag that indicates if annotations are enabled AnnotationsEnabled bool `json:"annotationsEnabled"` // Dashboard unique identifier referenced by this public dashboard DashboardUid string `json:"dashboardUid"` // Flag that indicates if the public dashboard is enabled IsEnabled bool `json:"isEnabled"` // Flag that indicates if the time range picker is enabled TimeSelectionEnabled bool `json:"timeSelectionEnabled"` // Unique public dashboard identifier Uid string `json:"uid"` }
Spec defines model for Spec.
type Status ¶
type Status struct { // additionalFields is reserved for future use AdditionalFields map[string]any `json:"additionalFields,omitempty"` // operatorStates is a map of operator ID to operator state evaluations. // Any operator which consumes this kind SHOULD add its state evaluation information to this field. OperatorStates map[string]StatusOperatorState `json:"operatorStates,omitempty"` }
Status defines model for Status.
type StatusOperatorState ¶
type StatusOperatorState struct { // descriptiveState is an optional more descriptive state field which has no requirements on format DescriptiveState *string `json:"descriptiveState,omitempty"` // details contains any extra information that is operator-specific Details map[string]any `json:"details,omitempty"` // lastEvaluation is the ResourceVersion last evaluated LastEvaluation string `json:"lastEvaluation"` // state describes the state of the lastEvaluation. // It is limited to three possible states for machine evaluation. State StatusOperatorStateState `json:"state"` }
StatusOperatorState defines model for status.#OperatorState.
type StatusOperatorStateState ¶
type StatusOperatorStateState string
StatusOperatorStateState state describes the state of the lastEvaluation. It is limited to three possible states for machine evaluation.
const ( StatusOperatorStateStateFailed StatusOperatorStateState = "failed" StatusOperatorStateStateInProgress StatusOperatorStateState = "in_progress" StatusOperatorStateStateSuccess StatusOperatorStateState = "success" )
Defines values for StatusOperatorStateState.