Directories
¶
| Path | Synopsis |
|---|---|
|
Package gserver implements a combined gRPC, gRPC-Web and REST server that listens on one or more URLs and multiplexes all three protocols on each listener.
|
Package gserver implements a combined gRPC, gRPC-Web and REST server that listens on one or more URLs and multiplexes all three protocols on each listener. |
|
credentials
Package credentials implements gRPC transport and per-RPC credentials for porto clients and servers.
|
Package credentials implements gRPC transport and per-RPC credentials for porto clients and servers. |
|
roles
Package roles maps authenticated callers to porto roles for both HTTP and gRPC requests.
|
Package roles maps authenticated callers to porto roles for both HTTP and gRPC requests. |
|
Package metricskey declares the metric descriptors emitted by porto's HTTP and gRPC servers (request latency and per-role counters, deployed version, logged-error counter).
|
Package metricskey declares the metric descriptors emitted by porto's HTTP and gRPC servers (request latency and per-role counters, deployed version, logged-error counter). |
|
pkg
|
|
|
appinit
Package appinit wires common service start-up concerns: logging setup, the metrics pipeline and optional CPU profiling.
|
Package appinit wires common service start-up concerns: logging setup, the metrics pipeline and optional CPU profiling. |
|
appinit/config
Package config defines the metrics pipeline configuration consumed by appinit.Metrics.
|
Package config defines the metrics pipeline configuration consumed by appinit.Metrics. |
|
cache
Package cache provides a small key/value cache abstraction (Provider) with a TTL per entry, a pattern-based key listing and a minimal publish/subscribe channel, backed either by process memory or by Redis.
|
Package cache provides a small key/value cache abstraction (Provider) with a TTL per entry, a pattern-based key listing and a minimal publish/subscribe channel, backed either by process memory or by Redis. |
|
crlcache
Package crlcache defines the Verifier interface used by transport.TLSInfo to check client certificates against a CRL or OCSP source.
|
Package crlcache defines the Verifier interface used by transport.TLSInfo to check client certificates against a CRL or OCSP source. |
|
discovery
Package discovery is a minimal in-process service registry keyed by server name and concrete type, resolved by interface.
|
Package discovery is a minimal in-process service registry keyed by server name and concrete type, resolved by interface. |
|
redisclient
Package redisclient wraps github.com/redis/go-redis/v9 with a key prefix, JSON marshalling of values, error wrapping and a set of higher-level helpers: bounded ("with eviction") sets and hashes, an owner-bound distributed lock and a one-execution-per-window rate limiter.
|
Package redisclient wraps github.com/redis/go-redis/v9 with a key prefix, JSON marshalling of values, error wrapping and a set of higher-level helpers: bounded ("with eviction") sets and hashes, an owner-bound distributed lock and a one-execution-per-window rate limiter. |
|
retriable
Package retriable provides an HTTP client with a configurable retry policy, JSON request/response marshalling, header propagation through context, bearer/DPoP authorization, replay-nonce handling and file-based token storage.
|
Package retriable provides an HTTP client with a configurable retry policy, JSON request/response marshalling, header propagation through context, bearer/DPoP authorization, replay-nonce handling and file-based token storage. |
|
revocation
Package revocation provides a revocation service for JWT tokens.
|
Package revocation provides a revocation service for JWT tokens. |
|
rpcclient
Package rpcclient builds gRPC client connections from a Config: it wires transport credentials, per-RPC bearer/DPoP tokens (loaded from the environment or from a retriable.Storage folder), keepalive parameters, message size limits and an optional blocking dial with timeout.
|
Package rpcclient builds gRPC client connections from a Config: it wires transport credentials, per-RPC bearer/DPoP tokens (loaded from the environment or from a retriable.Storage folder), keepalive parameters, message size limits and an optional blocking dial with timeout. |
|
streamctx
Package streamctx wraps a grpc.ServerStream so that its Context returns a replacement context.
|
Package streamctx wraps a grpc.ServerStream so that its Context returns a replacement context. |
|
tasks
Package tasks is an in-process, cron-like scheduler that runs Go functions periodically using a small, human-friendly schedule syntax.
|
Package tasks is an in-process, cron-like scheduler that runs Go functions periodically using a small, human-friendly schedule syntax. |
|
tlsconfig
Package tlsconfig builds tls.Config values from PEM files and keeps the certificate fresh with a file-polling reloader.
|
Package tlsconfig builds tls.Config values from PEM files and keeps the certificate fresh with a file-polling reloader. |
|
transport
Package transport provides net.Listener wrappers for servers: a TLS listener that performs the handshake eagerly with optional CRL checking, and keepalive listeners that enable TCP keepalive on accepted connections.
|
Package transport provides net.Listener wrappers for servers: a TLS listener that performs the handshake eagerly with optional CRL checking, and keepalive listeners that enable TCP keepalive on accepted connections. |
|
Package restserver provides an HTTP/HTTPS REST server that hosts a set of Service implementations behind a single httprouter-based mux.
|
Package restserver provides an HTTP/HTTPS REST server that hosts a set of Service implementations behind a single httprouter-based mux. |
|
authz
Package authz provides HTTP and gRPC authorization where URI paths (and their children) are allowed access by a set of roles.
|
Package authz provides HTTP and gRPC authorization where URI paths (and their children) are allowed access by a set of roles. |
|
ready
Package ready provides an http.Handler wrapper that gates requests on a readiness check.
|
Package ready provides an http.Handler wrapper that gates requests on a readiness check. |
|
telemetry
Package telemetry provides http.Handler middleware for request logging and request metrics, plus the ResponseCapture writer they rely on to observe the status code and body size of a response.
|
Package telemetry provides http.Handler middleware for request logging and request metrics, plus the ResponseCapture writer they rely on to observe the status code and body size of a response. |
|
tests
|
|
|
mockappcontainer
Package mockappcontainer builds a go.uber.org/dig container pre-populated with the dependencies gserver needs (config, JWT signer/parser, discovery), for use in tests:
|
Package mockappcontainer builds a go.uber.org/dig container pre-populated with the dependencies gserver needs (config, JWT signer/parser, discovery), for use in tests: |
|
testutils
Package testutils has small helpers for tests: allocating a free local port for a server under test and comparing values by their JSON encoding.
|
Package testutils has small helpers for tests: allocating a free local port for a server under test and comparing values by their JSON encoding. |
|
xhttp
|
|
|
correlation
Package correlation propagates a per-request correlation ID through http.Request contexts, gRPC metadata and log entries.
|
Package correlation propagates a per-request correlation ID through http.Request contexts, gRPC metadata and log entries. |
|
header
Package header defines constants for HTTP header names and common Content-Type values used across porto (X-Correlation-ID, Authorization, application/json, application/grpc-web+proto, ...).
|
Package header defines constants for HTTP header names and common Content-Type values used across porto (X-Correlation-ID, Authorization, application/json, application/grpc-web+proto, ...). |
|
httperror
Package httperror defines structured API errors that carry an HTTP status, a machine-readable code, a gRPC status code and the request correlation ID, and that know how to serialise themselves as a JSON HTTP response.
|
Package httperror defines structured API errors that carry an HTTP status, a machine-readable code, a gRPC status code and the request correlation ID, and that know how to serialise themselves as a JSON HTTP response. |
|
identity
Package identity extracts the caller's identity (role, subject, tenant, claims, auth method) and connection details (client IP, user agent, target) from HTTP requests or gRPC contexts and exposes them through the request context.
|
Package identity extracts the caller's identity (role, subject, tenant, claims, auth method) and connection details (client IP, user agent, target) from HTTP requests or gRPC contexts and exposes them through the request context. |
|
limits
Package limits defines shared server network limits.
|
Package limits defines shared server network limits. |
|
marshal
Package marshal provides helpers to write JSON HTTP responses and to decode JSON request bodies, using github.com/ugorji/go/codec.
|
Package marshal provides helpers to write JSON HTTP responses and to decode JSON request bodies, using github.com/ugorji/go/codec. |
Click to show internal directories.
Click to hide internal directories.