pluginrpcv1

package
v1.34.2-20240826150251... Latest Latest
Warning

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

Go to latest
Published: unknown License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Code_name = map[int32]string{
		0:  "CODE_UNSPECIFIED",
		1:  "CODE_CANCELED",
		2:  "CODE_UNKNOWN",
		3:  "CODE_INVALID_ARGUMENT",
		4:  "CODE_DEADLINE_EXCEEDED",
		5:  "CODE_NOT_FOUND",
		6:  "CODE_ALREADY_EXISTS",
		7:  "CODE_PERMISSION_DENIED",
		8:  "CODE_RESOURCE_EXHAUSTED",
		9:  "CODE_FAILED_PRECONDITION",
		10: "CODE_ABORTED",
		11: "CODE_OUT_OF_RANGE",
		12: "CODE_UNIMPLEMENTED",
		13: "CODE_INTERNAL",
		14: "CODE_UNAVAILABLE",
		15: "CODE_DATA_LOSS",
		16: "CODE_UNAUTHENTICATED",
	}
	Code_value = map[string]int32{
		"CODE_UNSPECIFIED":         0,
		"CODE_CANCELED":            1,
		"CODE_UNKNOWN":             2,
		"CODE_INVALID_ARGUMENT":    3,
		"CODE_DEADLINE_EXCEEDED":   4,
		"CODE_NOT_FOUND":           5,
		"CODE_ALREADY_EXISTS":      6,
		"CODE_PERMISSION_DENIED":   7,
		"CODE_RESOURCE_EXHAUSTED":  8,
		"CODE_FAILED_PRECONDITION": 9,
		"CODE_ABORTED":             10,
		"CODE_OUT_OF_RANGE":        11,
		"CODE_UNIMPLEMENTED":       12,
		"CODE_INTERNAL":            13,
		"CODE_UNAVAILABLE":         14,
		"CODE_DATA_LOSS":           15,
		"CODE_UNAUTHENTICATED":     16,
	}
)

Enum value maps for Code.

View Source
var File_buf_pluginrpc_v1_pluginrpc_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Code

type Code int32

A code for an error.

Matches with google.rpc.Code.

const (
	// The zero value.
	Code_CODE_UNSPECIFIED Code = 0
	// Indicates that the operation was canceled, typically by the
	Code_CODE_CANCELED Code = 1
	// Indicates that the operation failed for an unknown reason.
	Code_CODE_UNKNOWN Code = 2
	// Indicates that client supplied an invalid argument.
	Code_CODE_INVALID_ARGUMENT Code = 3
	// Indicates that deadline expired before the operation could complete.
	Code_CODE_DEADLINE_EXCEEDED Code = 4
	// Indicates that some requested entity (for example, a file or directory)
	// was not found.
	Code_CODE_NOT_FOUND Code = 5
	// Indicates that client attempted to create an entity (for example, a file
	// or directory) that already exists.
	Code_CODE_ALREADY_EXISTS Code = 6
	// Indicates that the caller doesn't have permission to execute the
	// specified operation.
	Code_CODE_PERMISSION_DENIED Code = 7
	// Indicates that some resource has been exhausted. For example, a per-user
	// quota may be exhausted or the entire file system may be full.
	Code_CODE_RESOURCE_EXHAUSTED Code = 8
	// Indicates that the system is not in a state required for the operation's execution.
	Code_CODE_FAILED_PRECONDITION Code = 9
	// Indicates that operation was aborted by the system, usually because of a
	// concurrency issue such as a sequencer check failure or transaction abort.
	Code_CODE_ABORTED Code = 10
	// Indicates that the operation was attempted past the valid range (for example,
	// seeking past end-of-file).
	Code_CODE_OUT_OF_RANGE Code = 11
	// Indicates that the operation isn't implemented, supported, or enabled in this service.
	Code_CODE_UNIMPLEMENTED Code = 12
	// Indicates that some invariants expected by the underlying system have been broken.
	// This code is reserved for serious errors.
	Code_CODE_INTERNAL Code = 13
	// Indicates that the service is currently unavailable. This is usually temporary, so
	// clients can back off and retry idempotent operations.
	Code_CODE_UNAVAILABLE Code = 14
	// Indicates that the operation has resulted in unrecoverable data loss or corruption.
	Code_CODE_DATA_LOSS Code = 15
	// Indicates that the request does not have valid authentication credentials for the operation.
	Code_CODE_UNAUTHENTICATED Code = 16
)

func (Code) Descriptor

func (Code) Descriptor() protoreflect.EnumDescriptor

func (Code) Enum

func (x Code) Enum() *Code

func (Code) EnumDescriptor deprecated

func (Code) EnumDescriptor() ([]byte, []int)

Deprecated: Use Code.Descriptor instead.

func (Code) Number

func (x Code) Number() protoreflect.EnumNumber

func (Code) String

func (x Code) String() string

func (Code) Type

func (Code) Type() protoreflect.EnumType

type Error

type Error struct {

	// The error code.
	Code Code `protobuf:"varint,1,opt,name=code,proto3,enum=buf.pluginrpc.v1.Code" json:"code,omitempty"`
	// The message of the error.
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

An error received over a transport as part of a Response.

func (*Error) Descriptor deprecated

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

Deprecated: Use Error.ProtoReflect.Descriptor instead.

func (*Error) GetCode

func (x *Error) GetCode() Code

func (*Error) GetMessage

func (x *Error) GetMessage() string

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) ProtoReflect

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

func (*Error) Reset

func (x *Error) Reset()

func (*Error) String

func (x *Error) String() string

type Procedure

type Procedure struct {

	// The path of the procedure.
	//
	// When mapped to a Protobuf method, this will be `/fully.qualified.package.Service/Method`.
	//
	// Example:
	//
	//	package buf.plugin.check.v1;
	//
	//	service LintService {
	//	  rpc Lint(LintRequest) returns (LintResponse);
	//	}
	//
	// The path would be `/buf.plugin.check.v1.LintService/Lint`.
	//
	// The path must be a valid URI.
	Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	// The args to invoke on the plugin to invoke this method per the protocol specification.
	//
	// Example: If the args are `["plugin, "lint"]`, this method would be invoked by calling
	// the binary with the args `plugin lint`.
	//
	// This is optional. If not set, the default is that the procedure can be called
	// by calling the path as the only argument.
	//
	// Args must be at least of length 2, may only consist of characters in [a-zA-Z0-9_-], and may not
	// start or end with a dash or underscore.
	Args []string `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"`
	// contains filtered or unexported fields
}

A specification of a single procedure that can be invoked within a plugin.

A prodecure has a path, and the args used to invoke it via the plugin.

func (*Procedure) Descriptor deprecated

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

Deprecated: Use Procedure.ProtoReflect.Descriptor instead.

func (*Procedure) GetArgs

func (x *Procedure) GetArgs() []string

func (*Procedure) GetPath

func (x *Procedure) GetPath() string

func (*Procedure) ProtoMessage

func (*Procedure) ProtoMessage()

func (*Procedure) ProtoReflect

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

func (*Procedure) Reset

func (x *Procedure) Reset()

func (*Procedure) String

func (x *Procedure) String() string

type Request

type Request struct {

	// The request value.
	//
	// May not be present.
	Value *anypb.Any `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

A request sent over a transport.

func (*Request) Descriptor deprecated

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

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetValue

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

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

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

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

type Response

type Response struct {

	// The response value.
	//
	// May or may not be present, regardless of if there is an Error.
	Value *anypb.Any `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// An error.
	//
	// May or may not be present, regardless of if there is a response value.
	Error *Error `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

A response received over a transport.

func (*Response) Descriptor deprecated

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

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetError

func (x *Response) GetError() *Error

func (*Response) GetValue

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

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

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

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

type Spec

type Spec struct {

	// The specifications of the Procedures implemented.
	//
	// All Procedures must have a unique path and args. The latter is unenforceable
	// via protovalidate, but users should assume that pluginrpc implementations
	// will enforce that args are unique.
	Procedures []*Procedure `protobuf:"bytes,1,rep,name=procedures,proto3" json:"procedures,omitempty"`
	// contains filtered or unexported fields
}

The response given when the `--spec` flag is passed to the plugin.

func (*Spec) Descriptor deprecated

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

Deprecated: Use Spec.ProtoReflect.Descriptor instead.

func (*Spec) GetProcedures

func (x *Spec) GetProcedures() []*Procedure

func (*Spec) ProtoMessage

func (*Spec) ProtoMessage()

func (*Spec) ProtoReflect

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

func (*Spec) Reset

func (x *Spec) Reset()

func (*Spec) String

func (x *Spec) String() string

Source Files

  • pluginrpc.pb.go

Jump to

Keyboard shortcuts

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