Documentation
¶
Overview ¶
Package internal contains core domain logic with zero Forge imports.
Index ¶
- func NewHash(alg ChecksumAlgorithm) (hash.Hash, error)
- func VerifyChecksum(r io.Reader, expected Checksum) error
- type Checksum
- type ChecksumAlgorithm
- type Route
- type RouteFunc
- type Router
- func (r *Router) AddBackend(name string, drv driver.Driver)
- func (r *Router) AddRoute(pattern, backend string)
- func (r *Router) AddRouteFunc(fn RouteFunc)
- func (r *Router) Backend(name string) driver.Driver
- func (r *Router) Backends() []string
- func (r *Router) Close(_ interface{ ... }) error
- func (r *Router) CloseAll(closeFn func(driver.Driver) error) error
- func (r *Router) Default() driver.Driver
- func (r *Router) Resolve(bucket, key string) driver.Driver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Checksum ¶
type Checksum struct {
Algorithm ChecksumAlgorithm `json:"algorithm"`
Value string `json:"value"`
}
Checksum holds integrity verification data.
func ComputeChecksum ¶
func ComputeChecksum(r io.Reader, alg ChecksumAlgorithm) (Checksum, error)
ComputeChecksum reads all data from r and computes a checksum using the specified algorithm. The reader is consumed entirely.
func ComputeChecksumBytes ¶
func ComputeChecksumBytes(data []byte, alg ChecksumAlgorithm) (Checksum, error)
ComputeChecksumBytes computes a checksum of the given byte slice.
type ChecksumAlgorithm ¶
type ChecksumAlgorithm string
ChecksumAlgorithm identifies the hash algorithm used for integrity verification.
const ( AlgSHA256 ChecksumAlgorithm = "sha256" AlgBlake3 ChecksumAlgorithm = "blake3" AlgXXHash ChecksumAlgorithm = "xxhash" )
type RouteFunc ¶
RouteFunc is a custom routing function that returns a backend name for the given bucket and key. Return empty string to use the default backend.
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router manages the default driver and named backends, resolving which driver should handle a given operation based on routing rules.
func (*Router) AddBackend ¶
AddBackend registers a named backend.
func (*Router) AddRouteFunc ¶
AddRouteFunc adds a custom routing function.
func (*Router) Backend ¶
Backend returns the driver registered under the given name. Returns nil if the backend is not found.
func (*Router) CloseAll ¶
CloseAll closes all drivers. This uses a concrete approach accepting a close function per driver.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package telemetry is the tracing and metrics plumbing Trove's packages share: the tracer every span comes from, span names and attribute keys, how a failed span is marked, and how a measurement reaches the caller's observe.Recorder.
|
Package telemetry is the tracing and metrics plumbing Trove's packages share: the tracer every span comes from, span names and attribute keys, how a failed span is marked, and how a measurement reaches the caller's observe.Recorder. |
|
Package telemetrytest records what Trove's telemetry emits, for tests: a span recorder installed as the global tracer provider, and an observe.Recorder that remembers every measurement and checks it against the metric definitions in package observe.
|
Package telemetrytest records what Trove's telemetry emits, for tests: a span recorder installed as the global tracer provider, and an observe.Recorder that remembers every measurement and checks it against the metric definitions in package observe. |