v1

package
v0.1.0-beta.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HydrateResources

func HydrateResources(model Model, fromDir string) error

func Model2Bundle

func Model2Bundle(model Model, output string) error

func Model2BundleDir

func Model2BundleDir(model Model, output string) error

func Model2BundleZip

func Model2BundleZip(model Model, outputZip string) error

func ValidateAPIProxy

func ValidateAPIProxy(v *APIProxy, path string) []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 *ServerList, path string) []error

func ValidateSharedFlow

func ValidateSharedFlow(v *SharedFlow, path string) []error

func ValidateSharedFlowBundle

func ValidateSharedFlowBundle(v *SharedFlowBundle, path string) []error

func ValidateSharedFlows

func ValidateSharedFlows(v *SharedFlows, 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) BundleFiles

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

func (*APIProxyModel) BundleRoot

func (a *APIProxyModel) BundleRoot() string

func (*APIProxyModel) DisplayName

func (a *APIProxyModel) DisplayName() string

func (*APIProxyModel) GetResources

func (a *APIProxyModel) GetResources() *Resources

func (*APIProxyModel) Hydrate

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

func (*APIProxyModel) Name

func (a *APIProxyModel) Name() string

func (*APIProxyModel) Revision

func (a *APIProxyModel) Revision() int

func (*APIProxyModel) Validate

func (a *APIProxyModel) Validate() 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   *ServerList `xml:"Server,omitempty"`

	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 Model

type Model interface {
	Name() string
	DisplayName() string
	Revision() int
	Validate() error
	BundleFiles() []BundleFile
	BundleRoot() string
	Hydrate(filePath string) error
	XML() ([]byte, error)
	YAML() ([]byte, error)
	GetResources() *Resources
}

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 SharedFlow

type SharedFlow struct {
	Name  string   `xml:"name,attr"`
	Steps StepList `xml:"Step"`

	UnknownNode AnyList `xml:",any"`
}

func (*SharedFlow) FileContents

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

func (*SharedFlow) FileName

func (a *SharedFlow) FileName() string

func (*SharedFlow) FilePath

func (a *SharedFlow) FilePath() string

func (*SharedFlow) XML

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

type SharedFlowBundle

type SharedFlowBundle 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
	Policies    *Deprecated `xml:"Policies"`
	Resources   *Deprecated `xml:"Resources"`
	SubType     *Deprecated `xml:"subType"`
	SharedFlows *Deprecated `xml:"SharedFlows"`

	UnknownNode AnyList `xml:",any"`
}

func (*SharedFlowBundle) FileContents

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

func (*SharedFlowBundle) FileName

func (a *SharedFlowBundle) FileName() string

func (*SharedFlowBundle) FilePath

func (a *SharedFlowBundle) FilePath() string

func (*SharedFlowBundle) XML

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

type SharedFlowBundleModel

type SharedFlowBundleModel struct {
	SharedFlowBundle SharedFlowBundle `xml:"SharedFlowBundle"`
	Policies         Policies         `xml:"Policies"`
	Resources        Resources        `xml:"Resources"`
	SharedFlows      SharedFlows      `xml:"SharedFlows"`

	UnknownNode AnyList `xml:",any"`

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

func NewSharedFlowBundleModel

func NewSharedFlowBundleModel(input string) (*SharedFlowBundleModel, error)

func (*SharedFlowBundleModel) BundleFiles

func (a *SharedFlowBundleModel) BundleFiles() []BundleFile

func (*SharedFlowBundleModel) BundleRoot

func (a *SharedFlowBundleModel) BundleRoot() string

func (*SharedFlowBundleModel) DisplayName

func (a *SharedFlowBundleModel) DisplayName() string

func (*SharedFlowBundleModel) GetResources

func (a *SharedFlowBundleModel) GetResources() *Resources

func (*SharedFlowBundleModel) Hydrate

func (a *SharedFlowBundleModel) Hydrate(filePath string) error

func (*SharedFlowBundleModel) Name

func (a *SharedFlowBundleModel) Name() string

func (*SharedFlowBundleModel) Revision

func (a *SharedFlowBundleModel) Revision() int

func (*SharedFlowBundleModel) Validate

func (a *SharedFlowBundleModel) Validate() error

func (*SharedFlowBundleModel) XML

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

func (*SharedFlowBundleModel) YAML

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

type SharedFlowList

type SharedFlowList []*SharedFlow

type SharedFlows

type SharedFlows struct {
	List SharedFlowList `xml:"SharedFlow,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

Jump to

Keyboard shortcuts

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