converter

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package converter implements adaptors for for conversion between API and Backend models.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RulesAPIToBackend

func RulesAPIToBackend(ars []api.Rule) []model.Rule

RulesAPIToBackend converts an API Rule structure slice to a Backend Rule structure slice.

func RulesBackendToAPI

func RulesBackendToAPI(brs []model.Rule) []api.Rule

RulesBackendToAPI converts a Backend Rule structure slice to an API Rule structure slice.

Types

type BGPPeerConverter added in v1.5.0

type BGPPeerConverter struct{}

BGPPeerConverter implements a set of functions used for converting between API and backend representations of the BGPPeer resource.

func (BGPPeerConverter) ConvertAPIToKVPair added in v1.5.0

func (p BGPPeerConverter) ConvertAPIToKVPair(a unversioned.Resource) (*model.KVPair, error)

ConvertAPIToKVPair converts an API Policy structure to a KVPair containing a backend BGPPeer and GlobalBGPPeerKey/HostBGPPeerKey.

func (BGPPeerConverter) ConvertKVPairToAPI added in v1.5.0

func (p BGPPeerConverter) ConvertKVPairToAPI(d *model.KVPair) (unversioned.Resource, error)

ConvertKVPairToAPI converts a KVPair containing a backend BGPPeer and GlobalBGPPeerKey/HostBGPPeerKey to an API BGPPeer structure.

func (BGPPeerConverter) ConvertMetadataToKey added in v1.5.0

func (p BGPPeerConverter) ConvertMetadataToKey(m unversioned.ResourceMetadata) (model.Key, error)

ConvertMetadataToKey converts a BGPPeerMetadata to a GlobalBGPPeerKey or HostBGPPeerKey.

type IPPoolConverter added in v1.6.0

type IPPoolConverter struct{}

IPPoolConverter implements a set of functions used for converting between API and backend representations of the IPPool resource.

func (IPPoolConverter) ConvertAPIToKVPair added in v1.6.0

func (p IPPoolConverter) ConvertAPIToKVPair(a unversioned.Resource) (*model.KVPair, error)

ConvertAPIToKVPair converts an API Policy structure to a KVPair containing a backend IPPool and IPPoolKey.

func (IPPoolConverter) ConvertKVPairToAPI added in v1.6.0

func (_ IPPoolConverter) ConvertKVPairToAPI(d *model.KVPair) (unversioned.Resource, error)

ConvertKVPairToAPI converts a KVPair containing a backend IPPool and IPPoolKey to an API IPPool structure.

func (IPPoolConverter) ConvertMetadataToKey added in v1.6.0

func (p IPPoolConverter) ConvertMetadataToKey(m unversioned.ResourceMetadata) (model.Key, error)

ConvertMetadataToKey converts a IPPoolMetadata to a IPPoolKey.

type PolicyConverter

type PolicyConverter struct{}

PolicyConverter implements a set of functions used for converting between API and backend representations of the Policy resource.

func (PolicyConverter) ConvertAPIToKVPair

func (p PolicyConverter) ConvertAPIToKVPair(a unversioned.Resource) (*model.KVPair, error)

ConvertAPIToKVPair converts an API Policy structure to a KVPair containing a backend Policy and PolicyKey.

func (PolicyConverter) ConvertKVPairToAPI

func (p PolicyConverter) ConvertKVPairToAPI(d *model.KVPair) (unversioned.Resource, error)

ConvertKVPairToAPI converts a KVPair containing a backend Policy and PolicyKey to an API Policy structure.

func (PolicyConverter) ConvertMetadataToKey

func (p PolicyConverter) ConvertMetadataToKey(m unversioned.ResourceMetadata) (model.Key, error)

ConvertMetadataToKey converts a PolicyMetadata to a PolicyKey

type ProfileConverter added in v1.7.0

type ProfileConverter struct{}

ProfileConverter implements a set of functions used for converting between API and backend representations of the Profile resource.

func (ProfileConverter) ConvertAPIToKVPair added in v1.7.0

func (c ProfileConverter) ConvertAPIToKVPair(a unversioned.Resource) (*model.KVPair, error)

ConvertAPIToKVPair converts an API Profile structure to a KVPair containing a backend Profile and ProfileKey.

func (ProfileConverter) ConvertKVPairToAPI added in v1.7.0

func (c ProfileConverter) ConvertKVPairToAPI(d *model.KVPair) (unversioned.Resource, error)

ConvertKVPairToAPI converts a KVPair containing a backend Profile and ProfileKey to an API Profile structure.

func (ProfileConverter) ConvertMetadataToKey added in v1.7.0

func (p ProfileConverter) ConvertMetadataToKey(m unversioned.ResourceMetadata) (model.Key, error)

ConvertMetadataToKey converts a ProfileMetadata to a ProfileKey

type WorkloadEndpointConverter added in v1.7.0

type WorkloadEndpointConverter struct{}

WorkloadEndpointConverter implements a set of functions used for converting between API and backend representations of the WorkloadEndpoint resource.

func (*WorkloadEndpointConverter) ConvertAPIToKVPair added in v1.7.0

func (w *WorkloadEndpointConverter) ConvertAPIToKVPair(a unversioned.Resource) (*model.KVPair, error)

ConvertAPIToKVPair converts an API WorkloadEndpoint structure to a KVPair containing a backend WorkloadEndpoint and WorkloadEndpointKey.

func (*WorkloadEndpointConverter) ConvertKVPairToAPI added in v1.7.0

func (w *WorkloadEndpointConverter) ConvertKVPairToAPI(d *model.KVPair) (unversioned.Resource, error)

ConvertKVPairToAPI converts a KVPair containing a backend WorkloadEndpoint and WorkloadEndpointKey to an API WorkloadEndpoint structure.

func (*WorkloadEndpointConverter) ConvertMetadataToKey added in v1.7.0

func (w *WorkloadEndpointConverter) ConvertMetadataToKey(m unversioned.ResourceMetadata) (model.Key, error)

ConvertMetadataToKey converts a WorkloadEndpointMetadata to a WorkloadEndpointKey

Jump to

Keyboard shortcuts

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