wiringutil

package
v0.0.0-...-e0434a4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConsumerProducerMetaName

func ConsumerProducerMetaName(consumer, producer voyager.ResourceName, postfixParts ...string) string

func ConsumerProducerResourceName

func ConsumerProducerResourceName(consumer, producer voyager.ResourceName, postfixParts ...string) smith_v1.ResourceName

func ConsumerProducerServiceBinding

func ConsumerProducerServiceBinding(consumer, producer voyager.ResourceName, serviceInstanceRef smith_v1.Reference) smith_v1.Resource

ConsumerProducerServiceBinding constructs a ServiceBinding to be consumed by a Voyager Resource consumer. ServiceInstance that is bound to is produced by Voyager Resource producer. This function should be used to generate ServiceBindings between two Voyager Resources.

This function assumes that producer exposes a single bindable ServiceInstance. If it is not the case and there is a need to bind to multiple ServiceInstances produced by the same producer, construct names (using ConsumerProducerResourceName() and ConsumerProducerMetaName() functions) with different postfixes.

func IsSameTarget

func IsSameTarget(a, b smith_v1.Reference) bool

IsSameTarget tests if two references refer to the same target.

func Merge

func Merge(winner, loser map[string]interface{}) (map[string]interface{}, error)

Merge two maps, only use loser's fields if those fields are missing in winner

func MetaName

func MetaName(resource voyager.ResourceName, postfixParts ...string) string

func ReferenceName

func ReferenceName(producer smith_v1.ResourceName, nameElems ...string) smith_v1.ReferenceName

ReferenceName constructs a Smith resource reference name for a particular resource name and name elements.

func ResourceInternalServiceBinding

func ResourceInternalServiceBinding(resource voyager.ResourceName, serviceInstance smith_v1.ResourceName, postfix string) smith_v1.Resource

ResourceInternalServiceBinding constructs a ServiceBinding that is both produced and consumed by an Orchestration resource resource. This function should be used to generate ServiceBindings that are internal to an Orchestration resource.

func ResourceName

func ResourceName(resource voyager.ResourceName, postfixParts ...string) smith_v1.ResourceName

func ServiceBinding

func ServiceBinding(bindingResourceName smith_v1.ResourceName, bindingMetaName string, serviceInstanceRef smith_v1.Reference) smith_v1.Resource

func ServiceInstanceMetaName

func ServiceInstanceMetaName(resource voyager.ResourceName) string

ServiceInstanceMetaName constructs a Kubernetes object meta name for a ServiceInstance for an Orchestration resource. This function is typically used to construct an object meta name for the main ServiceInstance produced by an autowiring function.

func ServiceInstanceResourceName

func ServiceInstanceResourceName(resource voyager.ResourceName) smith_v1.ResourceName

ServiceInstanceResourceName constructs a Smith resource name for a ServiceInstance for an Orchestration resource. This function is typically used to construct a resource name for the main ServiceInstance produced by an autowiring function.

func StripJSONFields

func StripJSONFields(obj map[string]interface{}, badStruct interface{})

StripJSONFields remove fields from an obj that are in badStruct. It is intended to be used after processing certain fields from a struct but the rest should be passed through (i.e. to the ServiceInstance object).

Types

type StatusAdapter

type StatusAdapter func(resource *orch_v1.StateResource, context *wiringplugin.WiringContext) wiringplugin.WiringResult

StatusAdapter provides legacy status behavior for autowiring plugins. This adapter is deprecated, implement the Status() function directly.

func (StatusAdapter) Status

func (StatusAdapter) WireUp

type TemporaryNewWiringMigrationAdapter

type TemporaryNewWiringMigrationAdapter func(resource *orch_v1.StateResource, context *wiringplugin.WiringContext) (*wiringplugin.WiringResultSuccess, bool, error)

func (TemporaryNewWiringMigrationAdapter) Status

func (TemporaryNewWiringMigrationAdapter) WireUp

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL