Documentation ¶
Index ¶
- func ApigwFilterToEnvoyNode(r *types.ApigwFilter) (node *envoyx.Node, err error)
- func ApigwRouteToEnvoyNode(r *types.ApigwRoute) (node *envoyx.Node, err error)
- func ApplicationToEnvoyNode(r *types.Application) (node *envoyx.Node, err error)
- func AuthClientToEnvoyNode(r *types.AuthClient) (node *envoyx.Node, err error)
- func DalConnectionToEnvoyNode(r *types.DalConnection) (node *envoyx.Node, err error)
- func DalSensitivityLevelToEnvoyNode(r *types.DalSensitivityLevel) (node *envoyx.Node, err error)
- func QueueToEnvoyNode(r *types.Queue) (node *envoyx.Node, err error)
- func ReportToEnvoyNode(r *types.Report) (node *envoyx.Node, err error)
- func RoleToEnvoyNode(r *types.Role) (node *envoyx.Node, err error)
- func SettingValueToEnvoyNode(r *types.SettingValue) (node *envoyx.Node, err error)
- func TemplateToEnvoyNode(r *types.Template) (node *envoyx.Node, err error)
- func UserToEnvoyNode(r *types.User) (node *envoyx.Node, err error)
- type StoreDecoder
- type StoreEncoder
- type UserGetter
- type YamlDecoder
- type YamlEncoder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApigwFilterToEnvoyNode ¶
func ApigwFilterToEnvoyNode(r *types.ApigwFilter) (node *envoyx.Node, err error)
func ApigwRouteToEnvoyNode ¶
func ApigwRouteToEnvoyNode(r *types.ApigwRoute) (node *envoyx.Node, err error)
func ApplicationToEnvoyNode ¶
func ApplicationToEnvoyNode(r *types.Application) (node *envoyx.Node, err error)
func AuthClientToEnvoyNode ¶
func AuthClientToEnvoyNode(r *types.AuthClient) (node *envoyx.Node, err error)
func DalConnectionToEnvoyNode ¶
func DalConnectionToEnvoyNode(r *types.DalConnection) (node *envoyx.Node, err error)
func DalSensitivityLevelToEnvoyNode ¶
func DalSensitivityLevelToEnvoyNode(r *types.DalSensitivityLevel) (node *envoyx.Node, err error)
func SettingValueToEnvoyNode ¶
func SettingValueToEnvoyNode(r *types.SettingValue) (node *envoyx.Node, err error)
func TemplateToEnvoyNode ¶
Types ¶
type StoreDecoder ¶
type StoreDecoder struct{}
StoreDecoder is responsible for generating Envoy nodes from already stored resources which can then be managed by Envoy and imported via an encoder.
func (StoreDecoder) Decode ¶
func (d StoreDecoder) Decode(ctx context.Context, p envoyx.DecodeParams) (out envoyx.NodeSet, err error)
Decode returns a set of envoy nodes based on the provided params
StoreDecoder expects the DecodeParam of `storer` and `dal` which conform to the store.Storer and dal.FullService interfaces.
type StoreEncoder ¶
type StoreEncoder struct{}
StoreEncoder is responsible for encoding Corteza resources into the database via the Storer or the DAL interface
@todo consider having a different encoder for the DAL resources
func (StoreEncoder) Encode ¶
func (e StoreEncoder) Encode(ctx context.Context, p envoyx.EncodeParams, rt string, nodes envoyx.NodeSet, tree envoyx.Traverser) (err error)
Encode encodes the given Corteza resources into the primary store
Encoding should not do any additional processing apart from matching with dependencies and runtime validation
The Encode function is called for every resource type where the resource appears at the root of the dependency tree. All of the root-level resources for that resource type are passed into the function. The encoding function must traverse the branches to encode all of the dependencies.
This flow is used to simplify the flow of how resources are encoded into YAML (and other documents) as well as to simplify batching.
Encode does not receive any placeholder nodes which are used solely for dependency resolution.
func (StoreEncoder) Prepare ¶
func (e StoreEncoder) Prepare(ctx context.Context, p envoyx.EncodeParams, rt string, nn envoyx.NodeSet) (err error)
Prepare performs some initial processing on the resource before it can be encoded
Preparation runs validation, default value initialization, matching with already existing instances, ...
The prepare function receives a set of nodes grouped by the resource type. This enables some batching optimization and simplifications when it comes to matching with existing resources.
Prepare does not receive any placeholder nodes which are used solely for dependency resolution.
type UserGetter ¶
type UserGetter struct {
// contains filtered or unexported fields
}
UserGetter is a utility struct to resolve user references from different parts of the system such as the dep graph and the database
func MakeUserGetter ¶
func MakeUserGetter(s store.Storer, tt envoyx.Traverser) (g *UserGetter)
type YamlDecoder ¶
type YamlDecoder struct{}
YamlDecoder is responsible for decoding YAML documents into Corteza resources which are then managed by envoy and imported via an encoder.
func (YamlDecoder) CanExt ¶
func (d YamlDecoder) CanExt(name string) (ok bool)
CanExt returns true if the provided file extension can be decoded with this decoder
func (YamlDecoder) CanFile ¶
func (d YamlDecoder) CanFile(f *os.File) (ok bool)
CanFile returns true if the provided file can be decoded with this decoder
func (YamlDecoder) Decode ¶
func (d YamlDecoder) Decode(ctx context.Context, p envoyx.DecodeParams) (out envoyx.NodeSet, err error)
Decode returns a set of envoy nodes based on the provided params
YamlDecoder expects the DecodeParam of `stream` which conforms to the io.Reader interface.
type YamlEncoder ¶
type YamlEncoder struct{}
YamlEncoder is responsible for encoding Corteza resources into a YAML supported format
func (YamlEncoder) Encode ¶
func (e YamlEncoder) Encode(ctx context.Context, p envoyx.EncodeParams, rt string, nodes envoyx.NodeSet, tt envoyx.Traverser) (err error)
Encode encodes the given Corteza resources into some YAML supported format
Encoding should not do any additional processing apart from matching with dependencies and runtime validation
Preparation runs validation, default value initialization, matching with already existing instances, ...
The prepare function receives a set of nodes grouped by the resource type. This enables some batching optimization and simplifications when it comes to matching with existing resources.
Prepare does not receive any placeholder nodes which are used solely for dependency resolution.