ctypes

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "1"

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Code    ErrorCode `json:"code"`
	Message string    `json:"message"`
}

Error is an RPC error payload.

func (Error) Error

func (e Error) Error() string

Error returns a readable error string.

type ErrorCode

type ErrorCode int

ErrorCode is a numeric service error code.

const DefaultErrorCode ErrorCode = 666

type ID

type ID string

ID is a request identifier.

type Method

type Method string

Method is an RPC method name.

type Request

type Request struct {
	Version string          `json:"lrpc"` //nolint:tagliatelle
	ID      ID              `json:"id"`
	Params  json.RawMessage `json:"params"`
}

Request is a common RPC request body.

type Response

type Response[T any] struct {
	Version string `json:"lrpc"` //nolint:tagliatelle
	ID      ID     `json:"id"`
	Error   *Error `json:"error,omitempty"`
	Result  T      `json:"result,omitempty"`
}

Response is a common RPC response body.

Jump to

Keyboard shortcuts

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