Documentation ¶
Overview ¶
Package manifest provides
Index ¶
- Constants
- func EnhanceError(o ObjectGeneric, err error) error
- func StringInterpolation(withPlaceholder, replacer string) string
- func UnsupportedAPIVersionErr(o ObjectGeneric) error
- func UnsupportedKindErr(o ObjectGeneric) error
- type AlertSilenceMetadata
- type LabelKey
- type LabelValue
- type Labels
- type Metadata
- type MetadataHolder
- type ObjectGeneric
- type ObjectHeader
- type ObjectInternal
- type ProjectMetadata
- type RoleBindingMetadata
Constants ¶
const StringInterpolationPlaceholder = "{}"
StringInterpolationPlaceholder common symbol to use in strings for interpolation e.g. "My amazing {} Service"
Variables ¶
This section is empty.
Functions ¶
func EnhanceError ¶
func EnhanceError(o ObjectGeneric, err error) error
EnhanceError annotates error with path of manifest source, if it exists if not returns the same error as passed as argument
func StringInterpolation ¶
StringInterpolation for arguments ("{}-my-{}-string-{}", "xd") returns string xd-my-xd-string-xd
func UnsupportedAPIVersionErr ¶
func UnsupportedAPIVersionErr(o ObjectGeneric) error
UnsupportedAPIVersionErr returns appropriate error for missing value in field apiVersion for not empty field apiVersion returns always that this version is not supported so have to be validated before
func UnsupportedKindErr ¶
func UnsupportedKindErr(o ObjectGeneric) error
UnsupportedKindErr returns appropriate error for missing value in field kind for not empty field kind returns always that is not supported for this apiVersion so have to be validated before
Types ¶
type AlertSilenceMetadata ¶
type AlertSilenceMetadata struct { Name string `json:"name" validate:"required,objectName" example:"name"` Project string `json:"project,omitempty" validate:"objectName" example:"default"` }
AlertSilenceMetadata defines only basic metadata fields - name and project which uniquely identifies object on project level.
type LabelValue ¶
type LabelValue = string
type Labels ¶
type Labels map[LabelKey][]LabelValue
type Metadata ¶
type Metadata struct { Name string `json:"name" validate:"required,objectName" example:"name"` DisplayName string `json:"displayName,omitempty" validate:"omitempty,min=0,max=63" example:"Prometheus Source"` Project string `json:"project,omitempty" validate:"objectName" example:"default"` Labels Labels `json:"labels,omitempty" validate:"omitempty,labels"` }
Metadata represents part of object which is common for all available Objects, for internal usage
type MetadataHolder ¶
type MetadataHolder struct {
Metadata Metadata `json:"metadata"`
}
MetadataHolder is an intermediate structure that can provides metadata related field to other structures
type ObjectGeneric ¶
type ObjectGeneric struct { ObjectHeader Spec json.RawMessage `json:"spec"` }
ObjectGeneric represents struct to which every Object is parsable Specific types of Object have different structures as Spec
func JSONToGenericObjects ¶
func JSONToGenericObjects(jsonPayload []byte) ([]ObjectGeneric, error)
JSONToGenericObjects parse JSON Array of Objects into generic objects
type ObjectHeader ¶
type ObjectHeader struct { APIVersion string `json:"apiVersion" validate:"required" example:"n9/v1alpha"` Kind string `json:"kind" validate:"required" example:"kind"` MetadataHolder ObjectInternal }
ObjectHeader represents Header which is common for all available Objects
type ObjectInternal ¶
type ObjectInternal struct { Organization string `json:"organization,omitempty" example:"nobl9-dev"` ManifestSrc string `json:",omitempty" example:"x.yml"` OktaClientID string `json:"-"` // used only by kind Agent }
ObjectInternal represents part of object which is only for internal usage, not exposed to the client, for internal usage
type ProjectMetadata ¶
type RoleBindingMetadata ¶
type RoleBindingMetadata struct {
Name string `json:"name" validate:"required,objectName" example:"name"`
}
Directories ¶
Path | Synopsis |
---|---|
Package v1alpha represents objects available in API n9/v1alpha
|
Package v1alpha represents objects available in API n9/v1alpha |
twindow
Package twindow provides enums and functions to operate with resources related to Time Windows
|
Package twindow provides enums and functions to operate with resources related to Time Windows |