transport

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2025 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package transport defines the network transport abstraction (client + codec) for the distributed backend. Concrete implementations (HTTP, gRPC, etc.) will satisfy the Client interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Get(ctx context.Context, node string, key string) ([]byte, bool, error)
	Set(ctx context.Context, node string, key string, value []byte, expiration time.Duration, replicate bool) error
	Remove(ctx context.Context, node string, key string, replicate bool) error
	Health(ctx context.Context, node string) error
}

Client defines network transport operations needed by distributed backend. This abstracts over HTTP, gRPC, etc.

type Codec

type Codec interface {
	Marshal(v any) ([]byte, error)
	Unmarshal(data []byte, v any) error
}

Codec marshals/unmarshals values for transport (can reuse backend serializers).

type RPCError

type RPCError struct {
	Op   string
	Node string
	Err  error
}

RPCError represents a transport-level error (placeholder for richer classification).

func (*RPCError) Error

func (e *RPCError) Error() string

Jump to

Keyboard shortcuts

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