Documentation
¶
Overview ¶
Package entitysync replicates schema-authorized runtime entities to Miren Cloud over the negotiated uplink.
Index ¶
- Constants
- type Ack
- type Change
- type ChangeBatch
- type ChangeOp
- type Config
- type Diagnostics
- func (d *Diagnostics) ObserveUplink(status uplink.Status)
- func (d *Diagnostics) SetCapabilityDisabled(reason string)
- func (d *Diagnostics) SetDisabled(reason string)
- func (d *Diagnostics) SetPreparation(state, detail string)
- func (d *Diagnostics) SetPreparationFailure(state, message string)
- func (d *Diagnostics) SnapshotStatus() Status
- type Event
- type Exporter
- type Link
- type Offer
- type Option
- type SnapshotBatch
- type SnapshotBegin
- type SnapshotComplete
- type SnapshotProgress
- type Status
Constants ¶
View Source
const ( Version1 uint = 1 TypeSnapshotBegin = "entity.snapshot.begin" TypeSnapshotBatch = "entity.snapshot.batch" TypeSnapshotComplete = "entity.snapshot.complete" TypeChangeBatch = "entity.change.batch" TypeAck = "entity.ack" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangeBatch ¶
type Config ¶
type Config struct {
ExportSchema string `json:"export_schema"`
Cursor int64 `json:"cursor"`
SnapshotRequired bool `json:"snapshot_required,omitempty"`
SourceEpoch string `json:"source_epoch"`
ResnapshotAfterSeconds int64 `json:"resnapshot_after_seconds,omitempty"`
ResnapshotIntervalSeconds int64 `json:"resnapshot_interval_seconds,omitempty"`
}
type Diagnostics ¶
type Diagnostics struct {
// contains filtered or unexported fields
}
Diagnostics collects transient state for the local debug interface.
func NewDiagnostics ¶
func NewDiagnostics(schemaDigest string) *Diagnostics
func (*Diagnostics) ObserveUplink ¶
func (d *Diagnostics) ObserveUplink(status uplink.Status)
func (*Diagnostics) SetCapabilityDisabled ¶
func (d *Diagnostics) SetCapabilityDisabled(reason string)
func (*Diagnostics) SetDisabled ¶
func (d *Diagnostics) SetDisabled(reason string)
func (*Diagnostics) SetPreparation ¶
func (d *Diagnostics) SetPreparation(state, detail string)
func (*Diagnostics) SetPreparationFailure ¶
func (d *Diagnostics) SetPreparationFailure(state, message string)
func (*Diagnostics) SnapshotStatus ¶
func (d *Diagnostics) SnapshotStatus() Status
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
func NewExporter ¶
type Option ¶
type Option func(*Exporter)
func WithDiagnostics ¶
func WithDiagnostics(diagnostics *Diagnostics) Option
WithDiagnostics publishes exporter progress to the local debug interface.
func WithStartGate ¶
func WithStartGate(ready <-chan struct{}) Option
WithStartGate delays entity reads and transmission until source preparation has completed. Capability negotiation still happens immediately so other capabilities on the shared uplink are never gated on entity migration.
type SnapshotBatch ¶
type SnapshotBegin ¶
type SnapshotComplete ¶
type SnapshotProgress ¶
type SnapshotProgress struct {
ID string
HeadRevision int64
NextRevision int64
PagesSent int64
EntitiesSent int64
CountsByKind map[string]int64
}
SnapshotProgress describes the snapshot currently being transmitted.
type Status ¶
type Status struct {
UplinkState string
SessionID string
HandshakeVersion uint
CapabilityState string
CapabilityVersion uint
PreparationState string
PreparationDetail string
SourceEpoch string
SchemaDigest string
Mode string
WaitReason string
CloudCursor int64
NextWatchRevision int64
Snapshot *SnapshotProgress
LastAcknowledgment *Event
LastError *Event
RetryAt time.Time
}
Status is a point-in-time view of runtime entity sync.
Click to show internal directories.
Click to hide internal directories.