internal

package
v0.0.0-...-07ff07d Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const GRPCMaxMessageBytes = 64 << 20

Variables

View Source
var ErrIntOverflow = errors.New("int64 に変換できません(オーバーフロー)")

Functions

func GRPCCallOptions

func GRPCCallOptions() grpc.DialOption

GRPCCallOptions returns the per-call message-size cap dial option used by callers that supply their own transport credentials (e.g. the admin binary's TLS-aware fanout). Without this, gRPC-Go's default ~4 MiB recv cap would silently fail RPCs once aggregated cluster-overview / matrix admin payloads exceed 4 MiB even though node servers (GRPCServerOptions) are configured for 64 MiB.

func GRPCDialOptions

func GRPCDialOptions() []grpc.DialOption

GRPCDialOptions returns the common insecure dial options used by node-local and node-to-node traffic.

func GRPCServerOptions

func GRPCServerOptions() []grpc.ServerOption

GRPCServerOptions keeps Raft replication and the public/internal APIs aligned on the same message-size budget.

func LoadBearerTokenFile

func LoadBearerTokenFile(path string, maxBytes int64, humanName string) (string, error)

LoadBearerTokenFile materialises a bearer-token file with a strict upper bound on size so a misconfigured path (for example, pointing at a log) cannot force an arbitrary allocation before the bearer-token check. The file is read through an io.LimitReader bounded to maxBytes+1 so a file that grows or is swapped between stat() and read() still cannot sneak past the cap.

The returned string has surrounding whitespace trimmed; an empty file (or one that is only whitespace) is reported as an error so operators notice the misconfiguration immediately.

The humanName is used in error messages to distinguish token files (e.g. "admin token" vs "node token"); callers typically pass a fixed string like "admin token" or "node token".

func Uint64ToInt

func Uint64ToInt(u uint64) (int, error)

func WithStacks

func WithStacks[T any](t T, err error) (T, error)

Types

type CleanupStack

type CleanupStack struct {
	// contains filtered or unexported fields
}

CleanupStack stores cleanup callbacks and runs them in LIFO order.

func (*CleanupStack) Add

func (c *CleanupStack) Add(fn func())

Add registers a cleanup callback.

func (*CleanupStack) Release

func (c *CleanupStack) Release()

Release discards all registered callbacks.

func (*CleanupStack) Run

func (c *CleanupStack) Run()

Run executes registered callbacks in reverse registration order.

Directories

Path Synopsis
Package backup implements the per-adapter logical-backup format defined in docs/design/2026_04_29_proposed_snapshot_logical_decoder.md (Phase 0) and reused by docs/design/2026_04_29_proposed_logical_backup.md (Phase 1).
Package backup implements the per-adapter logical-backup format defined in docs/design/2026_04_29_proposed_snapshot_logical_decoder.md (Phase 0) and reused by docs/design/2026_04_29_proposed_logical_backup.md (Phase 1).
Package encryption implements the AES-256-GCM envelope encryption scheme described in docs/design/2026_04_29_proposed_data_at_rest_encryption.md §4.
Package encryption implements the AES-256-GCM envelope encryption scheme described in docs/design/2026_04_29_proposed_data_at_rest_encryption.md §4.
kek
Package kek implements KEK (Key Encryption Key) providers that wrap and unwrap DEKs (Data Encryption Keys) per §5.1 of the data-at-rest encryption design.
Package kek implements KEK (Key Encryption Key) providers that wrap and unwrap DEKs (Data Encryption Keys) per §5.1 of the data-at-rest encryption design.
Package memwatch provides a user-space memory watchdog that triggers an orderly shutdown before the kernel OOM-killer sends SIGKILL.
Package memwatch provides a user-space memory watchdog that triggers an orderly shutdown before the kernel OOM-killer sends SIGKILL.
Package monoclock exposes a monotonic-raw clock for the lease-read path.
Package monoclock exposes a monotonic-raw clock for the lease-read path.
raftenginetest
Package raftenginetest provides a shared conformance test suite for raftengine.Engine implementations.
Package raftenginetest provides a shared conformance test suite for raftengine.Engine implementations.

Jump to

Keyboard shortcuts

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