rpc

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIVersionFromContext

func APIVersionFromContext(ctx context.Context) string

func APIVersionHeaderName

func APIVersionHeaderName() string

func BackoffDelayMs

func BackoffDelayMs(policy RetryPolicy, attempt int) int

func IsRetryableError

func IsRetryableError(err error) bool

func IsRetryableMethod

func IsRetryableMethod(method string) bool

func MapError

func MapError(err error) error

func MinSupportedAPIVersion

func MinSupportedAPIVersion() string

MinSupportedAPIVersion defines the server's minimum accepted API version. Transport interceptors should enforce this once the ConnectRPC binding lands.

func WithAPIVersion

func WithAPIVersion(ctx context.Context, version string) context.Context

func WrapRPCError

func WrapRPCError(err error, sessionID, toolName string) error

Types

type Code

type Code string
const (
	CodeOK                 Code = "ok"
	CodeInvalidArgument    Code = "invalid_argument"
	CodeNotFound           Code = "not_found"
	CodeAlreadyExists      Code = "already_exists"
	CodeFailedPrecondition Code = "failed_precondition"
	CodePermissionDenied   Code = "permission_denied"
	CodeResourceExhausted  Code = "resource_exhausted"
	CodeUnavailable        Code = "unavailable"
	CodeDeadlineExceeded   Code = "deadline_exceeded"
	CodeCanceled           Code = "canceled"
	CodeInternal           Code = "internal"
)

type RPCError

type RPCError struct {
	Code    Code
	Message string
	Details map[string]string
	Cause   error
}

func NewRPCError

func NewRPCError(code Code, msg string, cause error) *RPCError

func (*RPCError) Error

func (e *RPCError) Error() string

func (*RPCError) Unwrap

func (e *RPCError) Unwrap() error

type RetryPolicy

type RetryPolicy struct {
	MaxAttempts int
	BaseDelayMs int
	MaxDelayMs  int
}

func DefaultRetryPolicy

func DefaultRetryPolicy() RetryPolicy

Directories

Path Synopsis
Package wsrelay bridges WebSocket connections to the TerminalService RPC.
Package wsrelay bridges WebSocket connections to the TerminalService RPC.

Jump to

Keyboard shortcuts

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