...

Package gnostic_extension_v1

import "github.com/google/gnostic-models/extensions"
Overview
Index

Overview ▾

Index ▾

Variables
func Main(handler extensionHandler)
type ExtensionHandlerRequest
    func (*ExtensionHandlerRequest) Descriptor() ([]byte, []int)
    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
type ExtensionHandlerResponse
    func (*ExtensionHandlerResponse) Descriptor() ([]byte, []int)
    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
type Version
    func (*Version) Descriptor() ([]byte, []int)
    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
    func (*Wrapper) Descriptor() ([]byte, []int)
    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

Package files

extension.pb.go extensions.go

Variables

var File_extensions_extension_proto protoreflect.FileDescriptor

func Main

func Main(handler extensionHandler)

Main implements the main program of an extension handler.

type ExtensionHandlerRequest

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

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

Deprecated: Use ExtensionHandlerRequest.ProtoReflect.Descriptor instead.

func (*ExtensionHandlerRequest) GetCompilerVersion

func (x *ExtensionHandlerRequest) GetCompilerVersion() *Version

func (*ExtensionHandlerRequest) GetWrapper

func (x *ExtensionHandlerRequest) GetWrapper() *Wrapper

func (*ExtensionHandlerRequest) ProtoMessage

func (*ExtensionHandlerRequest) ProtoMessage()

func (*ExtensionHandlerRequest) ProtoReflect

func (x *ExtensionHandlerRequest) ProtoReflect() protoreflect.Message

func (*ExtensionHandlerRequest) Reset

func (x *ExtensionHandlerRequest) Reset()

func (*ExtensionHandlerRequest) String

func (x *ExtensionHandlerRequest) String() string

type ExtensionHandlerResponse

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

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

Deprecated: Use ExtensionHandlerResponse.ProtoReflect.Descriptor instead.

func (*ExtensionHandlerResponse) GetErrors

func (x *ExtensionHandlerResponse) GetErrors() []string

func (*ExtensionHandlerResponse) GetHandled

func (x *ExtensionHandlerResponse) GetHandled() bool

func (*ExtensionHandlerResponse) GetValue

func (x *ExtensionHandlerResponse) GetValue() *anypb.Any

func (*ExtensionHandlerResponse) ProtoMessage

func (*ExtensionHandlerResponse) ProtoMessage()

func (*ExtensionHandlerResponse) ProtoReflect

func (x *ExtensionHandlerResponse) ProtoReflect() protoreflect.Message

func (*ExtensionHandlerResponse) Reset

func (x *ExtensionHandlerResponse) Reset()

func (*ExtensionHandlerResponse) String

func (x *ExtensionHandlerResponse) String() string

type Version

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

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

Deprecated: Use Version.ProtoReflect.Descriptor instead.

func (*Version) GetMajor

func (x *Version) GetMajor() int32

func (*Version) GetMinor

func (x *Version) GetMinor() int32

func (*Version) GetPatch

func (x *Version) GetPatch() int32

func (*Version) GetSuffix

func (x *Version) GetSuffix() string

func (*Version) ProtoMessage

func (*Version) ProtoMessage()

func (*Version) ProtoReflect

func (x *Version) ProtoReflect() protoreflect.Message

func (*Version) Reset

func (x *Version) Reset()

func (*Version) String

func (x *Version) String() string

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"`
    // YAML-formatted extension value.
    Yaml string `protobuf:"bytes,3,opt,name=yaml,proto3" json:"yaml,omitempty"`
    // contains filtered or unexported fields
}

func (*Wrapper) Descriptor

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

Deprecated: Use Wrapper.ProtoReflect.Descriptor instead.

func (*Wrapper) GetExtensionName

func (x *Wrapper) GetExtensionName() string

func (*Wrapper) GetVersion

func (x *Wrapper) GetVersion() string

func (*Wrapper) GetYaml

func (x *Wrapper) GetYaml() string

func (*Wrapper) ProtoMessage

func (*Wrapper) ProtoMessage()

func (*Wrapper) ProtoReflect

func (x *Wrapper) ProtoReflect() protoreflect.Message

func (*Wrapper) Reset

func (x *Wrapper) Reset()

func (*Wrapper) String

func (x *Wrapper) String() string