openapiextension_v1

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

README

Extensions

This directory contains support code for building Gnostic extensions and associated examples.

Extensions are used to compile vendor or specification extensions into protocol buffer structures.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessExtension

func ProcessExtension(handleExtension extensionHandler)

ProcessExtension calles the handler for a specified extension.

Types

type ExtensionHandlerRequest

type ExtensionHandlerRequest struct {
	// The OpenAPI descriptions that were explicitly listed on the command line.
	// The specifications will appear in the order they are specified to gnostic.
	Wrapper *Wrapper `protobuf:"bytes,1,opt,name=wrapper,proto3" json:"wrapper,omitempty"`
	// The version number of openapi compiler.
	CompilerVersion      *Version `protobuf:"bytes,3,opt,name=compiler_version,json=compilerVersion,proto3" json:"compiler_version,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

An encoded Request is written to the ExtensionHandler's stdin.

func (*ExtensionHandlerRequest) Descriptor

func (*ExtensionHandlerRequest) Descriptor() ([]byte, []int)

func (*ExtensionHandlerRequest) GetCompilerVersion

func (m *ExtensionHandlerRequest) GetCompilerVersion() *Version

func (*ExtensionHandlerRequest) GetWrapper

func (m *ExtensionHandlerRequest) GetWrapper() *Wrapper

func (*ExtensionHandlerRequest) ProtoMessage

func (*ExtensionHandlerRequest) ProtoMessage()

func (*ExtensionHandlerRequest) Reset

func (m *ExtensionHandlerRequest) Reset()

func (*ExtensionHandlerRequest) String

func (m *ExtensionHandlerRequest) String() string

func (*ExtensionHandlerRequest) XXX_DiscardUnknown added in v0.3.0

func (m *ExtensionHandlerRequest) XXX_DiscardUnknown()

func (*ExtensionHandlerRequest) XXX_Marshal added in v0.3.0

func (m *ExtensionHandlerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ExtensionHandlerRequest) XXX_Merge added in v0.3.0

func (dst *ExtensionHandlerRequest) XXX_Merge(src proto.Message)

func (*ExtensionHandlerRequest) XXX_Size added in v0.3.0

func (m *ExtensionHandlerRequest) XXX_Size() int

func (*ExtensionHandlerRequest) XXX_Unmarshal added in v0.3.0

func (m *ExtensionHandlerRequest) XXX_Unmarshal(b []byte) error

type ExtensionHandlerResponse

type ExtensionHandlerResponse struct {
	// true if the extension is handled by the extension handler; false otherwise
	Handled bool `protobuf:"varint,1,opt,name=handled,proto3" json:"handled,omitempty"`
	// Error message.  If non-empty, the extension handling failed.
	// The extension handler process should exit with status code zero
	// even if it reports an error in this way.
	//
	// This should be used to indicate errors which prevent the extension from
	// operating as intended.  Errors which indicate a problem in gnostic
	// itself -- such as the input Document being unparseable -- should be
	// reported by writing a message to stderr and exiting with a non-zero
	// status code.
	Error []string `protobuf:"bytes,2,rep,name=error,proto3" json:"error,omitempty"`
	// text output
	Value                *any.Any `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The extensions writes an encoded ExtensionHandlerResponse to stdout.

func (*ExtensionHandlerResponse) Descriptor

func (*ExtensionHandlerResponse) Descriptor() ([]byte, []int)

func (*ExtensionHandlerResponse) GetError

func (m *ExtensionHandlerResponse) GetError() []string

func (*ExtensionHandlerResponse) GetHandled

func (m *ExtensionHandlerResponse) GetHandled() bool

func (*ExtensionHandlerResponse) GetValue

func (m *ExtensionHandlerResponse) GetValue() *any.Any

func (*ExtensionHandlerResponse) ProtoMessage

func (*ExtensionHandlerResponse) ProtoMessage()

func (*ExtensionHandlerResponse) Reset

func (m *ExtensionHandlerResponse) Reset()

func (*ExtensionHandlerResponse) String

func (m *ExtensionHandlerResponse) String() string

func (*ExtensionHandlerResponse) XXX_DiscardUnknown added in v0.3.0

func (m *ExtensionHandlerResponse) XXX_DiscardUnknown()

func (*ExtensionHandlerResponse) XXX_Marshal added in v0.3.0

func (m *ExtensionHandlerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ExtensionHandlerResponse) XXX_Merge added in v0.3.0

func (dst *ExtensionHandlerResponse) XXX_Merge(src proto.Message)

func (*ExtensionHandlerResponse) XXX_Size added in v0.3.0

func (m *ExtensionHandlerResponse) XXX_Size() int

func (*ExtensionHandlerResponse) XXX_Unmarshal added in v0.3.0

func (m *ExtensionHandlerResponse) XXX_Unmarshal(b []byte) error

type Version

type Version struct {
	Major int32 `protobuf:"varint,1,opt,name=major,proto3" json:"major,omitempty"`
	Minor int32 `protobuf:"varint,2,opt,name=minor,proto3" json:"minor,omitempty"`
	Patch int32 `protobuf:"varint,3,opt,name=patch,proto3" json:"patch,omitempty"`
	// A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should
	// be empty for mainline stable releases.
	Suffix               string   `protobuf:"bytes,4,opt,name=suffix,proto3" json:"suffix,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The version number of OpenAPI compiler.

func (*Version) Descriptor

func (*Version) Descriptor() ([]byte, []int)

func (*Version) GetMajor

func (m *Version) GetMajor() int32

func (*Version) GetMinor

func (m *Version) GetMinor() int32

func (*Version) GetPatch

func (m *Version) GetPatch() int32

func (*Version) GetSuffix

func (m *Version) GetSuffix() string

func (*Version) ProtoMessage

func (*Version) ProtoMessage()

func (*Version) Reset

func (m *Version) Reset()

func (*Version) String

func (m *Version) String() string

func (*Version) XXX_DiscardUnknown added in v0.3.0

func (m *Version) XXX_DiscardUnknown()

func (*Version) XXX_Marshal added in v0.3.0

func (m *Version) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Version) XXX_Merge added in v0.3.0

func (dst *Version) XXX_Merge(src proto.Message)

func (*Version) XXX_Size added in v0.3.0

func (m *Version) XXX_Size() int

func (*Version) XXX_Unmarshal added in v0.3.0

func (m *Version) XXX_Unmarshal(b []byte) error

type Wrapper

type Wrapper struct {
	// version of the OpenAPI specification in which this extension was written.
	Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	// Name of the extension
	ExtensionName string `protobuf:"bytes,2,opt,name=extension_name,json=extensionName,proto3" json:"extension_name,omitempty"`
	// Must be a valid yaml for the proto
	Yaml                 string   `protobuf:"bytes,3,opt,name=yaml,proto3" json:"yaml,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Wrapper) Descriptor

func (*Wrapper) Descriptor() ([]byte, []int)

func (*Wrapper) GetExtensionName

func (m *Wrapper) GetExtensionName() string

func (*Wrapper) GetVersion

func (m *Wrapper) GetVersion() string

func (*Wrapper) GetYaml

func (m *Wrapper) GetYaml() string

func (*Wrapper) ProtoMessage

func (*Wrapper) ProtoMessage()

func (*Wrapper) Reset

func (m *Wrapper) Reset()

func (*Wrapper) String

func (m *Wrapper) String() string

func (*Wrapper) XXX_DiscardUnknown added in v0.3.0

func (m *Wrapper) XXX_DiscardUnknown()

func (*Wrapper) XXX_Marshal added in v0.3.0

func (m *Wrapper) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Wrapper) XXX_Merge added in v0.3.0

func (dst *Wrapper) XXX_Merge(src proto.Message)

func (*Wrapper) XXX_Size added in v0.3.0

func (m *Wrapper) XXX_Size() int

func (*Wrapper) XXX_Unmarshal added in v0.3.0

func (m *Wrapper) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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