importer

package
v2.9.5+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2021 License: MPL-2.0 Imports: 10 Imported by: 13

Documentation

Index

Constants

View Source
const (
	NS_WSDL20 = "http://www.w3.org/ns/wsdl"
	NS_WSDL   = "http://schemas.xmlsoap.org/wsdl/"
	NS_SOAP   = "http://schemas.xmlsoap.org/wsdl/soap/"
	NS_SOAP12 = "http://schemas.xmlsoap.org/wsdl/soap12/"
	NS_HTTP   = "http://schemas.xmlsoap.org/wsdl/http/"
)
View Source
const (
	PROT_HTTP    = "http"
	PROT_SOAP    = "soap"
	PROT_SOAP_12 = "soap12"
)

Variables

This section is empty.

Functions

func ReplaceWildCards

func ReplaceWildCards(endpoint string) string

Types

type APIImporter

type APIImporter interface {
	LoadFrom(io.Reader) error
	ConvertIntoApiVersion(bool) (apidef.VersionInfo, error)
	InsertIntoAPIDefinitionAsVersion(apidef.VersionInfo, *apidef.APIDefinition, string) error
	ToAPIDefinition(string, string, bool) (*apidef.APIDefinition, error)
}

func GetImporterForSource

func GetImporterForSource(source APIImporterSource) (APIImporter, error)

type APIImporterSource

type APIImporterSource string
const ApiaryBluePrint APIImporterSource = "blueprint"
const SwaggerSource APIImporterSource = "swagger"
const WSDLSource APIImporterSource = "wsdl"

type BluePrintAST

type BluePrintAST struct {
	Version     string `json:"_version"`
	Description string `json:"description"`
	Metadata    []struct {
		Name  string `json:"name"`
		Value string `json:"value"`
	} `json:"metadata"`
	Name           string `json:"name"`
	ResourceGroups []struct {
		Description string `json:"description"`
		Name        string `json:"name"`
		Resources   []struct {
			Actions []struct {
				Description string `json:"description"`
				Examples    []struct {
					Description string `json:"description"`
					Name        string `json:"name"`
					Requests    []struct {
						Body        string `json:"body"`
						Description string `json:"description"`
						Headers     []struct {
							Name  string `json:"name"`
							Value string `json:"value"`
						} `json:"headers"`
						Name   string `json:"name"`
						Schema string `json:"schema"`
					} `json:"requests"`
					Responses []struct {
						Body        string `json:"body"`
						Description string `json:"description"`
						Headers     []struct {
							Name  string `json:"name"`
							Value string `json:"value"`
						} `json:"headers"`
						Name   string `json:"name"`
						Schema string `json:"schema"`
					} `json:"responses"`
				} `json:"examples"`
				Method     string `json:"method"`
				Name       string `json:"name"`
				Parameters []struct {
					Default     string `json:"default"`
					Description string `json:"description"`
					Example     string `json:"example"`
					Name        string `json:"name"`
					Required    bool   `json:"required"`
					Type        string `json:"type"`
					Values      []struct {
						Value string `json:"value"`
					} `json:"values"`
				} `json:"parameters"`
			} `json:"actions"`
			Description string `json:"description"`
			Model       struct {
				Body        string `json:"body"`
				Description string `json:"description"`
				Headers     []struct {
					Name  string `json:"name"`
					Value string `json:"value"`
				} `json:"headers"`
				Name   string `json:"name"`
				Schema string `json:"schema"`
			} `json:"model"`
			Name       string `json:"name"`
			Parameters []struct {
				Default     string `json:"default"`
				Description string `json:"description"`
				Example     string `json:"example"`
				Name        string `json:"name"`
				Required    bool   `json:"required"`
				Type        string `json:"type"`
				Values      []struct {
					Value string `json:"value"`
				} `json:"values"`
			} `json:"parameters"`
			UriTemplate string `json:"uriTemplate"`
		} `json:"resources"`
	} `json:"resourceGroups"`
}

func (*BluePrintAST) ConvertIntoApiVersion

func (b *BluePrintAST) ConvertIntoApiVersion(asMock bool) (apidef.VersionInfo, error)

func (*BluePrintAST) InsertIntoAPIDefinitionAsVersion

func (b *BluePrintAST) InsertIntoAPIDefinitionAsVersion(version apidef.VersionInfo, def *apidef.APIDefinition, versionName string) error

func (*BluePrintAST) LoadFrom

func (b *BluePrintAST) LoadFrom(r io.Reader) error

func (*BluePrintAST) ToAPIDefinition

func (b *BluePrintAST) ToAPIDefinition(orgID, upstreamURL string, asMock bool) (*apidef.APIDefinition, error)

type DefinitionObjectAST

type DefinitionObjectAST struct {
	Type       string                               `json:"type"`
	Required   []string                             `json:"required"`
	Properties map[string]DefinitionObjectFormatAST `json:"properties"`
}

type DefinitionObjectFormatAST

type DefinitionObjectFormatAST struct {
	Format string `json:"format"`
	Type   string `json:"type"`
}

type PathItemObject

type PathItemObject struct {
	Get     PathMethodObject `json:"get"`
	Put     PathMethodObject `json:"put"`
	Post    PathMethodObject `json:"post"`
	Patch   PathMethodObject `json:"patch"`
	Options PathMethodObject `json:"options"`
	Delete  PathMethodObject `json:"delete"`
	Head    PathMethodObject `json:"head"`
}

type PathMethodObject

type PathMethodObject struct {
	Description string                           `json:"description"`
	OperationID string                           `json:"operationId"`
	Responses   map[string]ResponseCodeObjectAST `json:"responses"`
}

type ResponseCodeObjectAST

type ResponseCodeObjectAST struct {
	Description string `json:"description"`
	Schema      struct {
		Items map[string]interface{} `json:"items"`
		Type  string                 `json:"type"`
	} `json:"schema"`
}

type SwaggerAST

type SwaggerAST struct {
	BasePath    string                         `json:"basePath"`
	Consumes    []string                       `json:"consumes"`
	Definitions map[string]DefinitionObjectAST `json:"definitions"`
	Host        string                         `json:"host"`
	Info        struct {
		Contact struct {
			Email string `json:"email"`
			Name  string `json:"name"`
			URL   string `json:"url"`
		} `json:"contact"`
		Description string `json:"description"`
		License     struct {
			Name string `json:"name"`
			URL  string `json:"url"`
		} `json:"license"`
		TermsOfService string `json:"termsOfService"`
		Title          string `json:"title"`
		Version        string `json:"version"`
	} `json:"info"`
	Paths    map[string]PathItemObject `json:"paths"`
	Produces []string                  `json:"produces"`
	Schemes  []string                  `json:"schemes"`
	Swagger  string                    `json:"swagger"`
}

func (*SwaggerAST) ConvertIntoApiVersion

func (s *SwaggerAST) ConvertIntoApiVersion(asMock bool) (apidef.VersionInfo, error)

func (*SwaggerAST) InsertIntoAPIDefinitionAsVersion

func (s *SwaggerAST) InsertIntoAPIDefinitionAsVersion(version apidef.VersionInfo, def *apidef.APIDefinition, versionName string) error

func (*SwaggerAST) LoadFrom

func (s *SwaggerAST) LoadFrom(r io.Reader) error

func (*SwaggerAST) ToAPIDefinition

func (s *SwaggerAST) ToAPIDefinition(orgId, upstreamURL string, as_mock bool) (*apidef.APIDefinition, error)

type WSDL

type WSDL struct {
	Services []*WSDLService `xml:"http://schemas.xmlsoap.org/wsdl/ service"`
	Bindings []*WSDLBinding `xml:"http://schemas.xmlsoap.org/wsdl/ binding"`
}

type WSDLAddress

type WSDLAddress struct {
	Location string `xml:"location,attr"`
}

type WSDLBinding

type WSDLBinding struct {
	Name       string           `xml:"name,attr"`
	Operations []*WSDLOperation `xml:"http://schemas.xmlsoap.org/wsdl/ operation"`
	Protocol   string
	Method     string
	// contains filtered or unexported fields
}

func (*WSDLBinding) UnmarshalXML

func (b *WSDLBinding) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type WSDLDef

type WSDLDef struct {
	Definition WSDL `xml:"http://schemas.xmlsoap.org/wsdl/ definitions"`
}

func (*WSDLDef) ConvertIntoApiVersion

func (def *WSDLDef) ConvertIntoApiVersion(bool) (apidef.VersionInfo, error)

func (*WSDLDef) InsertIntoAPIDefinitionAsVersion

func (def *WSDLDef) InsertIntoAPIDefinitionAsVersion(version apidef.VersionInfo, apidef *apidef.APIDefinition, versionName string) error

func (*WSDLDef) LoadFrom

func (s *WSDLDef) LoadFrom(r io.Reader) error

func (*WSDLDef) SetServicePortMapping

func (*WSDLDef) SetServicePortMapping(input map[string]string)

func (*WSDLDef) ToAPIDefinition

func (def *WSDLDef) ToAPIDefinition(orgId, upstreamURL string, as_mock bool) (*apidef.APIDefinition, error)

func (*WSDLDef) UnmarshalXML

func (def *WSDLDef) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type WSDLOperation

type WSDLOperation struct {
	Name             string `xml:"name,attr"`
	Endpoint         string
	IsUrlReplacement bool
}

func (*WSDLOperation) UnmarshalXML

func (op *WSDLOperation) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type WSDLPort

type WSDLPort struct {
	Name    string      `xml:"name,attr"`
	Binding string      `xml:"binding,attr"`
	Address WSDLAddress `xml:"address"`
}

type WSDLService

type WSDLService struct {
	Name  string      `xml:"name,attr"`
	Ports []*WSDLPort `xml:"http://schemas.xmlsoap.org/wsdl/ port"`
}

Jump to

Keyboard shortcuts

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