httpapi

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 51 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithClientIdentity

func WithClientIdentity(ctx context.Context, id string) context.Context

WithClientIdentity returns a new context carrying the TLS client identity extracted during request handling. The expectation is that middleware sets this based on the verified certificate's subject/serial.

Types

type Config

type Config struct {
	Store                      storage.Backend
	Crypto                     *storage.Crypto
	QueueService               *queue.Service
	SearchAdapter              search.Adapter
	NamespaceConfigs           *namespaces.ConfigStore
	DefaultNamespaceConfig     namespaces.Config
	IndexManager               *indexer.Manager
	Logger                     pslog.Logger
	Clock                      clock.Clock
	HAMode                     string
	HALeaseTTL                 time.Duration
	HASinglePresenceTTL        time.Duration
	DefaultNamespace           string
	JSONMaxBytes               int64
	AttachmentMaxBytes         int64
	CompactWriter              func(io.Writer, io.Reader, int64) error
	DefaultTTL                 time.Duration
	MaxTTL                     time.Duration
	AcquireBlock               time.Duration
	SpoolMemoryThreshold       int64
	TxnDecisionRetention       time.Duration
	TxnReplayInterval          time.Duration
	QueueDecisionCacheTTL      time.Duration
	QueueDecisionMaxApply      int
	QueueDecisionApplyTimeout  time.Duration
	StateCacheBytes            int64
	QueryDocPrefetch           int
	EnforceClientIdentity      bool
	MetaWarmupAttempts         int
	MetaWarmupInitialDelay     time.Duration
	MetaWarmupMaxDelay         time.Duration
	StateWarmupAttempts        int
	StateWarmupInitialDelay    time.Duration
	StateWarmupMaxDelay        time.Duration
	QueueMaxConsumers          int
	QueuePollInterval          time.Duration
	QueuePollJitter            time.Duration
	QueueResilientPollInterval time.Duration
	QueueListPageSize          int
	LSFObserver                *lsf.Observer
	QRFController              *qrf.Controller
	ShutdownState              func() ShutdownState
	ActivityHook               func()
	NamespaceTracker           *NamespaceTracker
	DisableHTTPTracing         bool
	TCAuthEnabled              bool
	TCTrustPool                *x509.CertPool
	DefaultCAPool              *x509.CertPool
	TCAllowDefaultCA           bool
	TCLeader                   *tcleader.Manager
	SelfEndpoint               string
	TCClusterIdentity          string
	TCJoinEndpoints            []string
	TCFanoutTimeout            time.Duration
	TCFanoutMaxAttempts        int
	TCFanoutBaseDelay          time.Duration
	TCFanoutMaxDelay           time.Duration
	TCFanoutMultiplier         float64
	TCFanoutGate               txncoord.FanoutGate
	TCFanoutTrustPEM           [][]byte
	TCLeaveFanout              func(context.Context) error
	TCClusterLeaveSelf         func()
	TCClusterJoinSelf          func()
	TCClientBundlePath         string
	TCServerBundle             *tlsutil.Bundle
	DisableMTLS                bool
}

Config groups the dependencies required by Handler.

type Handler

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

Handler wires HTTP endpoints to backend operations.

func New

func New(cfg Config) *Handler

New constructs a Handler using the supplied configuration.

func (*Handler) NodeActive added in v0.3.0

func (h *Handler) NodeActive() bool

NodeActive reports whether this server is currently active for failover mode.

func (*Handler) ObservedNamespaces added in v0.1.0

func (h *Handler) ObservedNamespaces() []string

ObservedNamespaces returns the namespaces seen by this handler since startup.

func (*Handler) Register

func (h *Handler) Register(mux *http.ServeMux)

Register wires the routes under /v1 and health endpoints.

func (*Handler) ReleaseHA added in v0.3.0

func (h *Handler) ReleaseHA(ctx context.Context)

ReleaseHA releases the HA lease via the handler's core service.

func (*Handler) StopHA added in v0.3.0

func (h *Handler) StopHA()

StopHA stops the HA lease refresh loop for the handler's core service.

func (*Handler) SweepIdleMaintenance added in v0.2.0

func (h *Handler) SweepIdleMaintenance(ctx context.Context, opts core.IdleSweepOptions) error

SweepIdleMaintenance runs low-impact maintenance sweeping when the server is idle.

func (*Handler) SweepTransactions added in v0.1.0

func (h *Handler) SweepTransactions(ctx context.Context, now time.Time) error

SweepTransactions replays committed/expired transaction records for recovery.

type NamespaceTracker added in v0.1.0

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

NamespaceTracker records namespaces observed by the handler/server so that background tasks (sweepers, diagnostics) can iterate all active namespaces.

func NewNamespaceTracker added in v0.1.0

func NewNamespaceTracker(defaultNamespace string) *NamespaceTracker

NewNamespaceTracker initializes a tracker seeded with the provided default namespace (if non-empty).

func (*NamespaceTracker) All added in v0.1.0

func (t *NamespaceTracker) All() []string

All returns a sorted slice of observed namespaces.

func (*NamespaceTracker) Observe added in v0.1.0

func (t *NamespaceTracker) Observe(namespace string)

Observe records namespace as active.

type ShutdownState added in v0.1.0

type ShutdownState struct {
	Draining  bool
	Remaining time.Duration
	Notify    bool
}

ShutdownState exposes the server's current shutdown posture.

Jump to

Keyboard shortcuts

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