internal

package
v0.0.0-...-aa92256 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const GRPCMaxMessageBytes = 64 << 20

Variables

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

Functions

func ConfigureGRPCForwardToken

func ConfigureGRPCForwardToken(token string)

ConfigureGRPCForwardToken configures node-to-node Forward calls in clusters with authenticated migration enabled. Other RPC credentials are unchanged.

func ConfigureGRPCTLS

func ConfigureGRPCTLS(caPath, certPath, keyPath string) error

ConfigureGRPCTLS installs transport credentials before node services start. Empty paths preserve the existing plaintext peer transport.

func GRPCApplicationDialOptions

func GRPCApplicationDialOptions() []grpc.DialOption

GRPCApplicationDialOptions preserves ordinary forwarding auth and message limits without selecting process-global TLS for runtime-owned transports.

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 GRPCClientTLSCredentials

func GRPCClientTLSCredentials(caPath string) (credentials.TransportCredentials, error)

GRPCClientTLSCredentials verifies peers using the given CA or system roots. The peer name is taken from the dial target; verification cannot be disabled.

func GRPCDialOptions

func GRPCDialOptions() []grpc.DialOption

GRPCDialOptions returns the common transport and message-size options for node-local and node-to-node traffic. TLS is explicitly configured at startup.

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)

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.

type GRPCBearerToken

type GRPCBearerToken string

GRPCBearerToken is never sent on an insecure gRPC connection.

func (GRPCBearerToken) GetRequestMetadata

func (t GRPCBearerToken) GetRequestMetadata(context.Context, ...string) (map[string]string, error)

func (GRPCBearerToken) RequireTransportSecurity

func (GRPCBearerToken) RequireTransportSecurity() bool

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_implemented_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_implemented_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.
encryptiontest
Package encryptiontest provides isolated encryption fixtures for tests.
Package encryptiontest provides isolated encryption fixtures for tests.
fsmwire
Package fsmwire defines the §6.3 / §11 binary wire format for the FSM-internal encryption Raft entry types (opcodes 0x03 / 0x04 / 0x05).
Package fsmwire defines the §6.3 / §11 binary wire format for the FSM-internal encryption Raft entry types (opcodes 0x03 / 0x04 / 0x05).
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.
fstest
Package fstest provides in-memory test doubles for exercising the filesystem service without a Raft cluster.
Package fstest provides in-memory test doubles for exercising the filesystem service without a Raft cluster.
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.
Package peersession implements the volatile, connection-bound v1 session component of the accepted catalog bootstrap design.
Package peersession implements the volatile, connection-bound v1 session component of the accepted catalog bootstrap design.
Package raftadmission owns process-local, revocable Raft operation handles.
Package raftadmission owns process-local, revocable Raft operation handles.
Package raftbootstrap provides local durable bootstrap format primitives and canonical codecs for guarded bootstrap control entries.
Package raftbootstrap provides local durable bootstrap format primitives and canonical codecs for guarded bootstrap control entries.
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.
Package runtimehealth reports local stateful readiness without performing writes.
Package runtimehealth reports local stateful readiness without performing writes.
Package serverwiring is the process wiring the server binaries share: the --keyviz* and --autoSplit* flag groups and what they build, the metrics and pprof listeners, and the SigV4 static-credentials loader.
Package serverwiring is the process wiring the server binaries share: the --keyviz* and --autoSplit* flag groups and what they build, the metrics and pprof listeners, and the SigV4 static-credentials loader.
Package testutil provides bounded waits and loopback listeners for tests.
Package testutil provides bounded waits and loopback listeners for tests.
cmd/importguard command
Command importguard checks imports in repository production source, including files excluded by the current platform or build tags.
Command importguard checks imports in repository production source, including files excluded by the current platform or build tags.
grpctest
Package grpctest runs loopback gRPC servers with production message limits.
Package grpctest runs loopback gRPC servers with production message limits.

Jump to

Keyboard shortcuts

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