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 ¶
RulesAPIToBackend converts an API Rule structure slice to a Backend 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 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