Documentation
¶
Overview ¶
Package anchorhttp provides an authenticated HTTPS quorum implementation of meldbase.RollbackAnchorStore. It is a reference trust-plane building block, not a replacement for independently operated failure domains.
Index ¶
- Constants
- Variables
- type Handler
- type HandlerOptions
- type QuorumOptions
- type QuorumStore
- func (store *QuorumStore) Advance(ctx context.Context, anchor meldbase.RollbackAnchor) error
- func (store *QuorumStore) CheckReplicas(ctx context.Context) ([]ReplicaCheck, error)
- func (store *QuorumStore) ConfigurationID() string
- func (store *QuorumStore) Load(ctx context.Context) (meldbase.RollbackAnchor, bool, error)
- func (store *QuorumStore) RollbackAnchorStatus() meldbase.RollbackAnchorStoreStatus
- func (store *QuorumStore) String() string
- type Replica
- type ReplicaCheck
- type ReplicaCheckState
Constants ¶
const ( // ProtocolVersion identifies the strict HTTP/JSON and signing contract. ProtocolVersion uint32 = 2 )
Variables ¶
var ( ErrAuthentication = errors.New("meldbase anchor HTTP: authentication failed") ErrConfiguration = errors.New("meldbase anchor HTTP: configuration or member mismatch") ErrConflict = errors.New("meldbase anchor HTTP: monotonic anchor conflict") ErrInsecureTransport = errors.New("meldbase anchor HTTP: HTTPS is required") ErrProtocol = errors.New("meldbase anchor HTTP: invalid protocol response") ErrQuorum = errors.New("meldbase anchor HTTP: quorum unavailable") )
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(options HandlerOptions) (*Handler, error)
NewHandler creates a multi-anchor HTTP handler backed by an existing trusted directory. Deploy it behind TLS; request authentication does not encrypt traffic or authenticate the server to the client.
type HandlerOptions ¶
type QuorumOptions ¶
type QuorumStore ¶
type QuorumStore struct {
// contains filtered or unexported fields
}
func NewQuorumStore ¶
func NewQuorumStore(options QuorumOptions) (*QuorumStore, error)
NewQuorumStore creates a majority-read/majority-write anchor store. Endpoint count must be one or an odd number of at least three, and duplicate endpoints are rejected so they cannot manufacture a quorum.
func (*QuorumStore) Advance ¶
func (store *QuorumStore) Advance(ctx context.Context, anchor meldbase.RollbackAnchor) error
func (*QuorumStore) CheckReplicas ¶
func (store *QuorumStore) CheckReplicas(ctx context.Context) ([]ReplicaCheck, error)
CheckReplicas waits for a signed GET result from every configured member. It is intended for qualification and operator diagnostics, not commit paths.
func (*QuorumStore) ConfigurationID ¶
func (store *QuorumStore) ConfigurationID() string
ConfigurationID returns the non-secret digest of the cluster and complete sorted static member list.
func (*QuorumStore) Load ¶
func (store *QuorumStore) Load(ctx context.Context) (meldbase.RollbackAnchor, bool, error)
func (*QuorumStore) RollbackAnchorStatus ¶
func (store *QuorumStore) RollbackAnchorStatus() meldbase.RollbackAnchorStoreStatus
RollbackAnchorStatus returns a lock-free, identity-free process-session snapshot suitable for Meldbase admin telemetry.
func (*QuorumStore) String ¶
func (store *QuorumStore) String() string
type Replica ¶
Replica binds one endpoint URL to the unique static member expected behind it. Distinct URLs with the same MemberID cannot manufacture a quorum.
type ReplicaCheck ¶
type ReplicaCheck struct {
MemberID string
State ReplicaCheckState
Exists bool
Anchor meldbase.RollbackAnchor
}
ReplicaCheck reports one full-membership qualification probe. Anchor is set only when State is ReplicaAvailable and Exists is true.
type ReplicaCheckState ¶
type ReplicaCheckState string
ReplicaCheckState is a fixed qualification classification for one configured static member. It contains no endpoint or database identity.
const ( ReplicaAvailable ReplicaCheckState = "available" ReplicaMissing ReplicaCheckState = "missing" ReplicaAuthentication ReplicaCheckState = "authentication-failure" ReplicaConfiguration ReplicaCheckState = "configuration-failure" ReplicaProtocol ReplicaCheckState = "protocol-failure" )