Documentation
¶
Index ¶
- func NewParameterParserError(context ParameterParserContext, reason string) error
- func NewParameterWriterError(context ParameterWriterContext, reason string) error
- type Parameter
- type ParameterParser
- type ParameterParserContext
- type ParameterParserError
- type ParameterReference
- type ParameterResolveValueError
- type ParameterSerDe
- type ParameterWriter
- type ParameterWriterContext
- type ParameterWriterError
- type Properties
- type ResolveContext
- type ResolvedEntities
- type ResolvedEntity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewParameterParserError ¶
func NewParameterParserError(context ParameterParserContext, reason string) error
func NewParameterWriterError ¶
func NewParameterWriterError(context ParameterWriterContext, reason string) error
Types ¶
type Parameter ¶
type Parameter interface {
// GetType returns the type of the parameter.
GetType() string
// GetReferences returns a slice of all other parameters this parameter references.
// this is need in the sorting phase to first deploy references, so that
// they an be resolved during deployment phase.
GetReferences() []ParameterReference
// ResolveValue resolves the value of this parameter. the context offers some more information
// on the current deployment and resolving phase. if the value cannot be resolved,
// an error should be returned.
ResolveValue(context ResolveContext) (interface{}, error)
}
type ParameterParser ¶
type ParameterParser func(ParameterParserContext) (Parameter, error)
function loading a parameter from a given context
type ParameterParserContext ¶
type ParameterParserContext struct {
// coordinates of the current config to parse
Coordinate coordinate.Coordinate
Group string
Environment string
// name of the current parameter to parse
ParameterName string
// current value to parse
Value map[string]interface{}
}
type ParameterParserError ¶
type ParameterParserError struct {
// Location of the config the error happened in
Location coordinate.Coordinate `json:"location"`
EnvironmentDetails errors.EnvironmentDetails `json:"environmentDetails"`
// ParameterName holds the name of the parameter triggering the error
ParameterName string `json:"parameterName"`
// Reason is a text describing what went wrong
Reason string `json:"reason"`
}
func (ParameterParserError) Coordinates ¶
func (p ParameterParserError) Coordinates() coordinate.Coordinate
func (ParameterParserError) Error ¶
func (p ParameterParserError) Error() string
func (ParameterParserError) LocationDetails ¶
func (p ParameterParserError) LocationDetails() errors.EnvironmentDetails
type ParameterReference ¶
type ParameterReference struct {
Config coordinate.Coordinate
Property string
}
ParameterReference is used to identify a certain parameter in a config
func (ParameterReference) String ¶
func (p ParameterReference) String() string
type ParameterResolveValueError ¶
type ParameterResolveValueError struct {
Location coordinate.Coordinate `json:"location"`
EnvironmentDetails errors.EnvironmentDetails `json:"environmentDetails"`
ParameterName string `json:"parameterName"`
Reason string `json:"reason"`
}
ParameterResolveValueError is used to indicate that an error occurred during the resolving phase of a parameter.
func NewParameterResolveValueError ¶
func NewParameterResolveValueError(context ResolveContext, reason string) ParameterResolveValueError
func (ParameterResolveValueError) Coordinates ¶
func (p ParameterResolveValueError) Coordinates() coordinate.Coordinate
func (ParameterResolveValueError) Error ¶
func (p ParameterResolveValueError) Error() string
func (ParameterResolveValueError) LocationDetails ¶
func (p ParameterResolveValueError) LocationDetails() errors.EnvironmentDetails
type ParameterSerDe ¶
type ParameterSerDe struct {
Serializer ParameterWriter
Deserializer ParameterParser
}
struct holding pointers to functions used to serialize and deserialize a parameter. this information is then used by the config loader.
type ParameterWriter ¶
type ParameterWriter func(ParameterWriterContext) (map[string]interface{}, error)
function used to transform a parameter to map structure, which can be serialized.
type ParameterWriterContext ¶
type ParameterWriterContext struct {
// coordinates of the current config to parse
Coordinate coordinate.Coordinate
Group string
Environment string
// name of the current parameter to parse
ParameterName string
// current value to parse
Parameter Parameter
}
type ParameterWriterError ¶
type ParameterWriterError struct {
// config the error happened in
Location coordinate.Coordinate `json:"location"`
EnvironmentDetails errors.EnvironmentDetails `json:"environmentDetails"`
// name of the parameter triggering the error
ParameterName string `json:"parameterName"`
// text describing what went wrong
Reason string `json:"reason"`
}
func (ParameterWriterError) Coordinates ¶
func (p ParameterWriterError) Coordinates() coordinate.Coordinate
func (ParameterWriterError) Error ¶
func (p ParameterWriterError) Error() string
func (ParameterWriterError) LocationDetails ¶
func (p ParameterWriterError) LocationDetails() errors.EnvironmentDetails
type Properties ¶
type Properties map[string]interface{}
Properties defines a map representing resolved parameters
type ResolveContext ¶
type ResolveContext struct {
// map of already resolved (and deployed) configs
ResolvedEntities ResolvedEntities
// coordinates of the current config
ConfigCoordinate coordinate.Coordinate
// group of the current config
Group string
// environment of the current config
Environment string
// name of the parameter to resolve
ParameterName string
// resolved values of the current config
ResolvedParameterValues Properties
}
ResolveContext used to give some more information on the resolving phase
type ResolvedEntities ¶
type ResolvedEntities map[coordinate.Coordinate]ResolvedEntity
ResolvedEntities defines a map representing resolved configs. this includes the api `ID` of a config.
type ResolvedEntity ¶
type ResolvedEntity struct {
// EntityName is the name returned by the Dynatrace api. In theory should be the
// same as the `name` property defined in the configuration, but
// can differ.
EntityName string
// coordinate of the config this entity represents
Coordinate coordinate.Coordinate
// Properties defines a map of all already resolved parameters
Properties Properties
// Skip flag indicating that this entity was skipped
// if a entity is skipped, there will be no properties
Skip bool
}
TODO move to better package ResolvedEntity struct representing an already deployed entity