v1

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIProxyModel2Bundle added in v0.1.5

func APIProxyModel2Bundle(proxyModel *APIProxyModel, output string) error

func APIProxyModel2BundleDir added in v0.1.5

func APIProxyModel2BundleDir(proxyModel *APIProxyModel, output string) error

func APIProxyModel2BundleZip added in v0.1.5

func APIProxyModel2BundleZip(proxyModel *APIProxyModel, outputZip string) error

func APIProxyModelYAML2Bundle added in v0.1.5

func APIProxyModelYAML2Bundle(input string, output string, validate bool, dryRun string) (err error)

func LoadAPIProxyModelResources

func LoadAPIProxyModelResources(proxyModel *APIProxyModel, fromDir string) error

func ReadAPIProxyModelFromYAML

func ReadAPIProxyModelFromYAML(filePath string) (*yaml.Node, error)

func ValidateAPIProxy

func ValidateAPIProxy(v *APIProxy, path string) []error

func ValidateAPIProxyModel

func ValidateAPIProxyModel(v *APIProxyModel) error

func ValidateAudience

func ValidateAudience(v *Audience, path string) []error

func ValidateAuthentication

func ValidateAuthentication(v *Authentication, path string) []error

func ValidateDefaultFaultRule

func ValidateDefaultFaultRule(v *DefaultFaultRule, path string) []error

func ValidateFaultRule

func ValidateFaultRule(v *FaultRule, path string) []error

func ValidateFaultRules

func ValidateFaultRules(v *FaultRules, path string) []error

func ValidateFlow

func ValidateFlow(v *Flow, path string) []error

func ValidateFlows

func ValidateFlows(v *Flows, path string) []error

func ValidateGoogleAccessToken

func ValidateGoogleAccessToken(v *GoogleAccessToken, path string) []error

func ValidateGoogleIDToken

func ValidateGoogleIDToken(v *GoogleIDToken, path string) []error

func ValidateHTTPProxyConnection

func ValidateHTTPProxyConnection(v *HTTPProxyConnection, path string) []error

func ValidateHTTPTargetConnection

func ValidateHTTPTargetConnection(v *HTTPTargetConnection, path string) []error

func ValidateLoadBalancer

func ValidateLoadBalancer(v *LoadBalancer, path string) []error

func ValidateLocalTargetConnection

func ValidateLocalTargetConnection(v *LocalTargetConnection, path string) []error

func ValidatePostFlow

func ValidatePostFlow(v *PostFlow, path string) []error

func ValidatePreFlow

func ValidatePreFlow(v *PreFlow, path string) []error

func ValidateProperties

func ValidateProperties(v *Properties, path string) []error

func ValidateProperty

func ValidateProperty(v *Property, path string) []error

func ValidateProxyEndpoint

func ValidateProxyEndpoint(v *ProxyEndpoint, path string) []error

func ValidateProxyEndpoints

func ValidateProxyEndpoints(v *ProxyEndpoints, path string) []error

func ValidateRequest

func ValidateRequest(v *Request, path string) []error

func ValidateResource

func ValidateResource(v *Resource, path string) []error

func ValidateResources

func ValidateResources(v *Resources, path string) []error

func ValidateResponse

func ValidateResponse(v *Response, path string) []error

func ValidateRouteRule

func ValidateRouteRule(v *RouteRule, path string) []error

func ValidateRouteRules

func ValidateRouteRules(v *RouteRuleList, path string) []error

func ValidateSSLInfo

func ValidateSSLInfo(v *SSLInfo, path string) []error

func ValidateServer

func ValidateServer(v *Server, path string) []error

func ValidateServers

func ValidateServers(v *Servers, path string) []error

func ValidateStep

func ValidateStep(v *Step, path string) []error

func ValidateSteps

func ValidateSteps(v *StepList, path string) []error

func ValidateTargetEndpoint

func ValidateTargetEndpoint(v *TargetEndpoint, path string) []error

func ValidateTargetEndpoints

func ValidateTargetEndpoints(v *TargetEndpoints, path string) []error

Types

type APIProxy

type APIProxy struct {
	Revision       int    `xml:"revision,attr"`
	Name           string `xml:"name,attr"`
	DisplayName    string `xml:"DisplayName,omitempty"`
	Description    string `xml:"Description,omitempty"`
	CreatedAt      int64  `xml:"CreatedAt,omitempty"`
	LastModifiedAt int64  `xml:"LastModifiedAt,omitempty"`

	//-- deprecated fields
	Spec                 *Deprecated `xml:"Spec"`
	ConfigurationVersion *Deprecated `xml:"ConfigurationVersion"`
	BasePaths            *Deprecated `xml:"BasePaths"`
	Policies             *Deprecated `xml:"Policies"`
	Resources            *Deprecated `xml:"Resources"`
	ProxyEndpoints       *Deprecated `xml:"ProxyEndpoints"`
	TargetEndpoints      *Deprecated `xml:"TargetEndpoints"`

	UnknownNode AnyList `xml:",any"`
}

func (*APIProxy) FileContents

func (a *APIProxy) FileContents() ([]byte, error)

func (*APIProxy) FileName

func (a *APIProxy) FileName() string

func (*APIProxy) FilePath

func (a *APIProxy) FilePath() string

func (*APIProxy) XML

func (a *APIProxy) XML() ([]byte, error)

type APIProxyModel

type APIProxyModel struct {
	APIProxy        APIProxy        `xml:"APIProxy"`
	Policies        Policies        `xml:"Policies"`
	ProxyEndpoints  ProxyEndpoints  `xml:"ProxyEndpoints"`
	TargetEndpoints TargetEndpoints `xml:"TargetEndpoints"`
	Resources       Resources       `xml:"Resources"`

	UnknownNode AnyList `xml:",any"`

	YAMLDoc *yaml.Node `xml:"-"`
}

func NewAPIProxyModel

func NewAPIProxyModel(input string) (*APIProxyModel, error)

func (*APIProxyModel) GetBundleFiles

func (a *APIProxyModel) GetBundleFiles() []BundleFile

func (*APIProxyModel) HydrateModelFromYAMLDoc

func (a *APIProxyModel) HydrateModelFromYAMLDoc(filePath string) error

func (*APIProxyModel) XML

func (a *APIProxyModel) XML() ([]byte, error)

func (*APIProxyModel) YAML

func (a *APIProxyModel) YAML() ([]byte, error)

type APIProxyRef

type APIProxyRef struct {
	Value string `xml:",chardata"`
}

type AnyList

type AnyList []*AnyNode

type AnyNode

type AnyNode struct {
	XMLName  xml.Name
	Attrs    []xml.Attr `xml:",any,attr"`
	CharData []byte     `xml:",chardata"`
	Children []AnyNode  `xml:",any"`
}

type Audience

type Audience struct {
	Ref          string `xml:"ref,attr,omitempty"`
	UseTargetUrl bool   `xml:"useTargetUrl,attr,omitempty"`
	Value        string `xml:",chardata"`

	UnknownNode AnyList `xml:",any"`
}

type Authentication

type Authentication struct {
	GoogleIDToken     *GoogleIDToken     `xml:"GoogleIDToken"`
	GoogleAccessToken *GoogleAccessToken `xml:"GoogleAccessToken"`

	UnknownNode AnyList `xml:",any"`
}

type BundleFile

type BundleFile interface {
	FileContents() ([]byte, error)
	FileName() string
	FilePath() string
}

type DefaultFaultRule

type DefaultFaultRule struct {
	Name          string   `xml:"name,attr,omitempty"`
	AlwaysEnforce bool     `xml:"AlwaysEnforce,omitempty"`
	Steps         StepList `xml:"Step"`

	UnknownNode AnyList `xml:",any"`
}

type Deprecated

type Deprecated AnyNode

type Extension

type Extension struct {
	Name  string
	Value *yaml.Node
}

type FaultRule

type FaultRule struct {
	Name      string   `xml:"name,attr,omitempty"`
	Condition string   `xml:"Condition,omitempty"`
	Steps     StepList `xml:"Step"`

	UnknownNode AnyList `xml:",any"`
}

type FaultRuleList

type FaultRuleList []*FaultRule

type FaultRules

type FaultRules struct {
	List FaultRuleList `xml:"FaultRule"`

	UnknownNode AnyList `xml:",any"`
}

type Flow

type Flow struct {
	Name        string    `xml:"name,attr"`
	Description string    `xml:"Description,omitempty"`
	Condition   string    `xml:"Condition,omitempty"`
	Request     *Request  `xml:"Request"`
	Response    *Response `xml:"Response"`

	UnknownNode AnyList `xml:",any"`
}

type FlowList

type FlowList []*Flow

type Flows

type Flows struct {
	List FlowList `xml:"Flow,omitempty"`

	UnknownNode AnyList `xml:",any"`
}

type GoogleAccessToken

type GoogleAccessToken struct {
	Scopes ScopeList `xml:">Scope,omitempty"`

	UnknownNode AnyList `xml:",any"`
}

type GoogleIDToken

type GoogleIDToken struct {
	Audience *Audience `xml:"Audience"`

	UnknownNode AnyList `xml:",any"`
}

type HTTPProxyConnection

type HTTPProxyConnection struct {
	BasePath   string      `xml:"BasePath"`
	Properties *Properties `xml:"Properties"`

	UnknownNode AnyList `xml:",any"`
}

type HTTPTargetConnection

type HTTPTargetConnection struct {
	URL            string          `xml:"URL,omitempty"`
	Path           string          `xml:"Path,omitempty"`
	Authentication *Authentication `xml:"Authentication,omitempty"`
	LoadBalancer   *LoadBalancer   `xml:"LoadBalancer,omitempty"`
	SSLInfo        *SSLInfo        `xml:"SSLInfo,omitempty"`
	Properties     *Properties     `xml:"Properties"`

	UnknownNode AnyList `xml:",any"`
}

type LoadBalancer

type LoadBalancer struct {
	Algorithm string   `xml:"Algorithm,omitempty"`
	Servers   *Servers `xml:"Servers"`

	UnknownNode AnyList `xml:",any"`
}

type LocalTargetConnection

type LocalTargetConnection struct {
	Path          string            `xml:"Path,omitempty"`
	APIProxy      *APIProxyRef      `xml:"APIProxy,omitempty"`
	ProxyEndpoint *ProxyEndpointRef `xml:"ProxyEndpoint,omitempty"`

	UnknownNode AnyList `xml:",any"`
}

type Policies

type Policies struct {
	List PolicyList `xml:",any"`
}

type Policy

type Policy AnyNode

func (*Policy) FileContents

func (p *Policy) FileContents() ([]byte, error)

func (*Policy) FileName

func (p *Policy) FileName() string

func (*Policy) FilePath

func (p *Policy) FilePath() string

func (*Policy) Name

func (p *Policy) Name() string

func (*Policy) Type

func (p *Policy) Type() string

func (*Policy) XML

func (p *Policy) XML() ([]byte, error)

type PolicyList

type PolicyList []*Policy

type PostFlow

type PostFlow struct {
	Name        string    `xml:"name,attr"`
	Description string    `xml:"Description,omitempty"`
	Request     *Request  `xml:"Request"`
	Response    *Response `xml:"Response"`

	UnknownNode AnyList `xml:",any"`
}

type PreFlow

type PreFlow struct {
	Name        string    `xml:"name,attr"`
	Description string    `xml:"Description,omitempty"`
	Request     *Request  `xml:"Request"`
	Response    *Response `xml:"Response"`

	UnknownNode AnyList `xml:",any"`
}

type Properties

type Properties struct {
	List PropertyList `xml:"Property,omitempty"`

	UnknownNode AnyList `xml:",any"`
}

type Property

type Property struct {
	Name      string `xml:"name,attr"`
	ValueAttr string `xml:"value,attr,omitempty"`
	RefAttr   string `xml:"ref,attr,omitempty"`
	Value     string `xml:",chardata"`

	UnknownNode AnyList `xml:",any"`
}

type PropertyList

type PropertyList []*Property

type ProxyEndpoint

type ProxyEndpoint struct {
	Name                string               `xml:"name,attr"`
	Description         string               `xml:"Description,omitempty"`
	FaultRules          *FaultRules          `xml:"FaultRules"`
	DefaultFaultRule    *DefaultFaultRule    `xml:"DefaultFaultRule,omitempty"`
	PreFlow             *PreFlow             `xml:"PreFlow,omitempty"`
	Flows               *Flows               `xml:"Flows,omitempty"`
	PostFlow            *PostFlow            `xml:"PostFlow,omitempty"`
	HTTPProxyConnection *HTTPProxyConnection `xml:"HTTPProxyConnection,omitempty"`
	RouteRules          *RouteRuleList       `xml:"RouteRule,omitempty"`

	UnknownNode AnyList `xml:",any"`
}

func (*ProxyEndpoint) FileContents

func (p *ProxyEndpoint) FileContents() ([]byte, error)

func (*ProxyEndpoint) FileName

func (p *ProxyEndpoint) FileName() string

func (*ProxyEndpoint) FilePath

func (p *ProxyEndpoint) FilePath() string

func (*ProxyEndpoint) XML

func (p *ProxyEndpoint) XML() ([]byte, error)

type ProxyEndpointList

type ProxyEndpointList []*ProxyEndpoint

type ProxyEndpointRef

type ProxyEndpointRef struct {
	Value string `xml:",chardata"`
}

type ProxyEndpoints

type ProxyEndpoints struct {
	List ProxyEndpointList `xml:"ProxyEndpoint,omitempty"`

	UnknownNode AnyList `xml:",any"`
}

type Request

type Request struct {
	Steps StepList `xml:"Step,omitempty"`

	UnknownNode AnyList `xml:",any"`
}

type Resource

type Resource struct {
	Type    string `xml:"Type"`
	Path    string `xml:"Path"`
	Content []byte `xml:"-"`

	UnknownNode AnyList `xml:",any"`
}

func (*Resource) FileContents

func (p *Resource) FileContents() ([]byte, error)

func (*Resource) FileName

func (p *Resource) FileName() string

func (*Resource) FilePath

func (p *Resource) FilePath() string

type ResourceList

type ResourceList []*Resource

type Resources

type Resources struct {
	List ResourceList `xml:"Resource,omitempty"`

	UnknownNode AnyList `xml:",any"`
}

type Response

type Response struct {
	Steps StepList `xml:"Step,omitempty"`

	UnknownNode AnyList `xml:",any"`
}

type RouteRule

type RouteRule struct {
	Name           string `xml:"name,attr"`
	Condition      string `xml:"Condition,omitempty"`
	TargetEndpoint string `xml:"TargetEndpoint,omitempty"`

	UnknownNode AnyList `xml:",any"`
}

type RouteRuleList

type RouteRuleList []*RouteRule

type SSLInfo

type SSLInfo struct {
	Enabled                bool   `xml:"Enabled"`
	Enforce                bool   `xml:"Enforce"`
	ClientAuthEnabled      bool   `xml:"ClientAuthEnabled,omitempty"`
	KeyStore               string `xml:"KeyStore,omitempty"`
	KeyAlias               string `xml:"KeyAlias,omitempty"`
	TrustStore             string `xml:"TrustStore,omitempty"`
	IgnoreValidationErrors bool   `xml:"IgnoreValidationErrors,omitempty"`

	UnknownNode AnyList `xml:",any"`
}

type Scope

type Scope struct {
	Value string `xml:",chardata"`
}

type ScopeList

type ScopeList []*Scope

type Server

type Server struct {
	Name       string `xml:"name,attr"`
	IsFallback bool   `xml:"IsFallback,omitempty"`

	UnknownNode AnyList `xml:",any"`
}

type ServerList

type ServerList []*Server

type Servers

type Servers struct {
	List ServerList `xml:"Server,omitempty"`

	UnknownNode AnyList `xml:",any"`
}

type Step

type Step struct {
	Name      string `xml:"Name"`
	Condition string `xml:"Condition,omitempty"`

	UnknownNode AnyList `xml:",any"`
}

type StepList

type StepList []*Step

type TargetEndpoint

type TargetEndpoint struct {
	Name                  string                 `xml:"name,attr"`
	Description           string                 `xml:"Description,omitempty"`
	FaultRules            *FaultRules            `xml:"FaultRules,omitempty"`
	DefaultFaultRule      *DefaultFaultRule      `xml:"DefaultFaultRule,omitempty"`
	PreFlow               PreFlow                `xml:"PreFlow"`
	Flows                 Flows                  `xml:"Flows"`
	PostFlow              PostFlow               `xml:"PostFlow"`
	HTTPTargetConnection  *HTTPTargetConnection  `xml:"HTTPTargetConnection,omitempty"`
	LocalTargetConnection *LocalTargetConnection `xml:"LocalTargetConnection,omitempty"`

	UnknownNode AnyList `xml:",any"`
}

func (*TargetEndpoint) FileContents

func (p *TargetEndpoint) FileContents() ([]byte, error)

func (*TargetEndpoint) FileName

func (p *TargetEndpoint) FileName() string

func (*TargetEndpoint) FilePath

func (p *TargetEndpoint) FilePath() string

func (*TargetEndpoint) XML

func (p *TargetEndpoint) XML() ([]byte, error)

type TargetEndpoints

type TargetEndpoints struct {
	List TargetEndpointsList `xml:"TargetEndpoint,omitempty"`

	UnknownNode AnyList `xml:",any"`
}

type TargetEndpointsList

type TargetEndpointsList []*TargetEndpoint

type UnknownNodeError

type UnknownNodeError struct {
	Location string
	Node     *AnyNode
}

func (*UnknownNodeError) Error

func (e *UnknownNodeError) Error() string

type ValidationErrors added in v0.1.9

type ValidationErrors struct {
	Errors []error
}

func (ValidationErrors) Error added in v0.1.9

func (e ValidationErrors) Error() string

Jump to

Keyboard shortcuts

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