Documentation
¶
Overview ¶
Package server serves Racer HTTPS endpoints from locally validated authority.
Index ¶
- Constants
- type Config
- type Leader
- type Lifecycle
- func (*Lifecycle) NeedLeaderElection() bool
- func (l *Lifecycle) ProcessContext(parent context.Context) (context.Context, context.CancelFunc)
- func (l *Lifecycle) Ready(_ *http.Request) error
- func (l *Lifecycle) SetCacheSync(wait func(context.Context) bool)
- func (l *Lifecycle) SetServingReady(ready bool)
- func (l *Lifecycle) Start(ctx context.Context) error
- type Limits
- type Server
Constants ¶
const ReplicationPath = "/internal/v1/snapshot"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ControlAddress string
TLSCertificateFile string
TLSPrivateKeyFile string
ReplicationServerName string
Limits Limits
}
Config contains only the HTTPS serving inputs, copied by New.
type Leader ¶
type Leader interface {
LeaderContext() (context.Context, bool)
PollInterval() time.Duration
AuthenticateReplica(context.Context, *http.Request) (string, time.Time, error)
}
Leader is the publisher view needed by the internal replication endpoint.
type Lifecycle ¶
type Lifecycle struct {
// contains filtered or unexported fields
}
Lifecycle owns process serving, independently of the leader-owned publishers.
func NewLifecycle ¶
func (*Lifecycle) NeedLeaderElection ¶
func (*Lifecycle) ProcessContext ¶
ProcessContext binds a request to the serving process lifetime. Missing or canceled process lifetime returns an already-canceled child.
func (*Lifecycle) SetCacheSync ¶
SetCacheSync supplies the cache barrier before Start is called.
func (*Lifecycle) SetServingReady ¶
SetServingReady is set only after the authenticated listener is accepting.
type Server ¶
func New ¶
func New(cfg Config, writer client.Writer, auth *authority.Authority, lifecycle *Lifecycle, leader Leader) *Server
New composes serving dependencies without starting work or granting readiness.
func (*Server) Handler ¶
Handler uses exact paths/methods without ServeMux redirects or implicit HEAD.
func (*Server) NeedLeaderElection ¶
func (*Server) Start ¶
Start opens TLS before public readiness so controller replication cannot deadlock on bootstrap. Process cancellation closes connections and polls.
func (*Server) TLSConfig ¶
TLSConfig must use VerifyClientCertIfGiven: bootstrap can omit the client certificate, while snapshot explicitly requires VerifiedChains. Resumption and pooled requests must not extend certificate validity or stale trust. The caller owns the reload lifetime and must supply and cancel a cancelable context, including when listener setup fails. Start owns this context itself.