var File_extensions_extension_proto protoreflect.FileDescriptor
func Main(handler extensionHandler)
Main implements the main program of an extension handler.
An encoded Request is written to the ExtensionHandler's stdin.
type ExtensionHandlerRequest struct { // The extension to process. Wrapper *Wrapper `protobuf:"bytes,1,opt,name=wrapper,proto3" json:"wrapper,omitempty"` // The version number of Gnostic. CompilerVersion *Version `protobuf:"bytes,2,opt,name=compiler_version,json=compilerVersion,proto3" json:"compiler_version,omitempty"` // contains filtered or unexported fields }
func (*ExtensionHandlerRequest) Descriptor() ([]byte, []int)
Deprecated: Use ExtensionHandlerRequest.ProtoReflect.Descriptor instead.
func (x *ExtensionHandlerRequest) GetCompilerVersion() *Version
func (x *ExtensionHandlerRequest) GetWrapper() *Wrapper
func (*ExtensionHandlerRequest) ProtoMessage()
func (x *ExtensionHandlerRequest) ProtoReflect() protoreflect.Message
func (x *ExtensionHandlerRequest) Reset()
func (x *ExtensionHandlerRequest) String() string
The extensions writes an encoded ExtensionHandlerResponse to stdout.
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(s). 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. Errors []string `protobuf:"bytes,2,rep,name=errors,proto3" json:"errors,omitempty"` // text output Value *anypb.Any `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*ExtensionHandlerResponse) Descriptor() ([]byte, []int)
Deprecated: Use ExtensionHandlerResponse.ProtoReflect.Descriptor instead.
func (x *ExtensionHandlerResponse) GetErrors() []string
func (x *ExtensionHandlerResponse) GetHandled() bool
func (x *ExtensionHandlerResponse) GetValue() *anypb.Any
func (*ExtensionHandlerResponse) ProtoMessage()
func (x *ExtensionHandlerResponse) ProtoReflect() protoreflect.Message
func (x *ExtensionHandlerResponse) Reset()
func (x *ExtensionHandlerResponse) String() string
The version number of Gnostic.
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"` // contains filtered or unexported fields }
func (*Version) Descriptor() ([]byte, []int)
Deprecated: Use Version.ProtoReflect.Descriptor instead.
func (x *Version) GetMajor() int32
func (x *Version) GetMinor() int32
func (x *Version) GetPatch() int32
func (x *Version) GetSuffix() string
func (*Version) ProtoMessage()
func (x *Version) ProtoReflect() protoreflect.Message
func (x *Version) Reset()
func (x *Version) String() string
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"` // YAML-formatted extension value. Yaml string `protobuf:"bytes,3,opt,name=yaml,proto3" json:"yaml,omitempty"` // contains filtered or unexported fields }
func (*Wrapper) Descriptor() ([]byte, []int)
Deprecated: Use Wrapper.ProtoReflect.Descriptor instead.
func (x *Wrapper) GetExtensionName() string
func (x *Wrapper) GetVersion() string
func (x *Wrapper) GetYaml() string
func (*Wrapper) ProtoMessage()
func (x *Wrapper) ProtoReflect() protoreflect.Message
func (x *Wrapper) Reset()
func (x *Wrapper) String() string