converter

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2017 License: Apache-2.0 Imports: 4 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 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

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

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

ConvertMetadataToKey converts a PolicyMetadata to a PolicyKey

Jump to

Keyboard shortcuts

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