Documentation ¶
Overview ¶
Package manifest provides
Index ¶
- Constants
- Variables
- func EnhanceError(o ObjectGeneric, err error) error
- func KindNames() []string
- func StringInterpolation(withPlaceholder, replacer string) string
- func UnsupportedAPIVersionErr(o ObjectGeneric) error
- func UnsupportedKindErr(o ObjectGeneric) error
- type AlertSilenceMetadata
- type Kind
- 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 ¶
var ErrInvalidKind = fmt.Errorf("not a valid Kind, try [%s]", strings.Join(_KindNames, ", "))
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 KindNames ¶ added in v0.20.0
func KindNames() []string
KindNames returns a list of possible string values of Kind.
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 Kind ¶ added in v0.20.0
type Kind int
Kind represents all the object kinds available in the API to perform operations on.
ENUM(
SLO = 1 Service Agent AlertPolicy AlertSilence Alert Project AlertMethod Direct DataExport RoleBinding Annotation UserGroup )
const ( // KindSLO is a Kind of type SLO. KindSLO Kind = iota + 1 // KindService is a Kind of type Service. KindService // KindAgent is a Kind of type Agent. KindAgent // KindAlertPolicy is a Kind of type AlertPolicy. KindAlertPolicy // KindAlertSilence is a Kind of type AlertSilence. KindAlertSilence // KindAlert is a Kind of type Alert. KindAlert // KindProject is a Kind of type Project. KindProject // KindAlertMethod is a Kind of type AlertMethod. KindAlertMethod // KindDirect is a Kind of type Direct. KindDirect // KindDataExport is a Kind of type DataExport. KindDataExport // KindRoleBinding is a Kind of type RoleBinding. KindRoleBinding // KindAnnotation is a Kind of type Annotation. KindAnnotation // KindUserGroup is a Kind of type UserGroup. KindUserGroup )
func ApplicableKinds ¶ added in v0.20.0
func ApplicableKinds() []Kind
ApplicableKinds returns all the Kind instances which can be applied or deleted by the user.
func KindValues ¶ added in v0.20.0
func KindValues() []Kind
KindValues returns a list of the values for Kind
func (Kind) Applicable ¶ added in v0.20.0
Applicable returns true if the Kind can be applied or deleted by the user. In other words, it informs whether the Kind's lifecycle is managed by the user.
func (Kind) Equals ¶ added in v0.20.0
Equals returns true if the Kind is equal to the given string. The comparison is case-insensitive.
func (Kind) IsValid ¶ added in v0.20.0
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (Kind) MarshalText ¶ added in v0.20.0
MarshalText implements the text encoding.TextMarshaler interface.
func (*Kind) UnmarshalText ¶ added in v0.20.0
UnmarshalText implements the text encoding.TextUnmarshaler interface.
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 Kind `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 |