Documentation
¶
Index ¶
- func IsValidationError(err error) bool
- func New(log *slog.Logger, core provider, domain string, opts ...connect.HandlerOption) *http.ServeMux
- func NewLoggingInterceptor(log *slog.Logger) connect.Option
- func NewValidationError(format string, args ...any) error
- func NewWithConfig(log *slog.Logger, core provider, domain string, cfg CommitResolution, ...) *http.ServeMux
- func RequestIDFrom(ctx context.Context) string
- func WithRequestID(ctx context.Context, id string) context.Context
- type CommitResolution
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidationError ¶ added in v0.3.2
IsValidationError reports whether err — or anything in its wrap chain — originated from NewValidationError.
func New ¶
func New( log *slog.Logger, core provider, domain string, opts ...connect.HandlerOption, ) *http.ServeMux
New creates and returns gRPC server. Commit-resolution enhancements (pre-warm, sha probe) are disabled; production should use NewWithConfig to enable them.
func NewLoggingInterceptor ¶ added in v0.3.2
NewLoggingInterceptor returns a connect.Option that wraps unary handlers with structured request/response logging at debug level.
func NewValidationError ¶ added in v0.3.2
NewValidationError formats and returns a validation error. Use this anywhere the client sent input we cannot accept; the connect-go handler will surface it as CodeInvalidArgument (HTTP 400) with the formatted message as detail.
func NewWithConfig ¶ added in v0.3.6
func NewWithConfig( log *slog.Logger, core provider, domain string, cfg CommitResolution, opts ...connect.HandlerOption, ) *http.ServeMux
NewWithConfig is like New but enables commit-resolution enhancements per cfg. PrewarmEnabled launches a best-effort background HEAD sweep; ProbeEnabled turns on the upstream sha probe for Download cache misses.
func RequestIDFrom ¶ added in v0.3.2
RequestIDFrom extracts the request ID from context, returning empty string if absent.
Types ¶
type CommitResolution ¶ added in v0.3.6
type CommitResolution struct {
PrewarmEnabled bool
PrewarmTimeout time.Duration
ProbeEnabled bool
ProbeNegativeTTL time.Duration
ProbeTimeout time.Duration
}
CommitResolution configures the buf v1 commit-id resolution enhancements in commitServiceHandler: startup HEAD pre-warm and the upstream sha probe used on a Download cache miss. It is the connect-package mirror of the user-facing connect config — kept here (not imported from cmd/easyp/internal/config) to avoid an internal→cmd layering violation. A zero value disables both enhancements (the historical behavior), so callers that construct the mux via New (tests) are unaffected; production threads it via NewWithConfig.