Documentation
¶
Index ¶
- type HTTPStatusError
- type MutationEntry
- type MutationTransport
- type PullMutationsResponse
- type PulledMutation
- type PushMutationsResult
- type RemoteTransport
- func (rt *RemoteTransport) PullMutations(_ int64, _ int) (*PullMutationsResponse, error)
- func (rt *RemoteTransport) PushMutations(_ []MutationEntry) (*PushMutationsResult, error)
- func (rt *RemoteTransport) ReadChunk(chunkID string) ([]byte, error)
- func (rt *RemoteTransport) ReadManifest() (*engramsync.Manifest, error)
- func (rt *RemoteTransport) WriteChunk(chunkID string, data []byte, entry engramsync.ChunkEntry) error
- func (rt *RemoteTransport) WriteManifest(_ *engramsync.Manifest) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPStatusError ¶ added in v1.13.0
type HTTPStatusError struct {
Operation string
StatusCode int
ErrorClass string
ErrorCode string
Body string
}
func (*HTTPStatusError) Error ¶ added in v1.13.0
func (e *HTTPStatusError) Error() string
func (*HTTPStatusError) IsAuthFailure ¶ added in v1.13.0
func (e *HTTPStatusError) IsAuthFailure() bool
func (*HTTPStatusError) IsPolicyFailure ¶ added in v1.13.0
func (e *HTTPStatusError) IsPolicyFailure() bool
func (*HTTPStatusError) IsRepairable ¶ added in v1.14.4
func (e *HTTPStatusError) IsRepairable() bool
func (*HTTPStatusError) IsRepairableMigrationFailure ¶ added in v1.13.0
func (e *HTTPStatusError) IsRepairableMigrationFailure() bool
type MutationEntry ¶
type MutationTransport ¶ added in v1.13.0
type MutationTransport struct {
// contains filtered or unexported fields
}
MutationTransport handles push/pull of fine-grained mutations to the cloud server. Unlike RemoteTransport (which handles chunk-level sync), this operates on the mutation journal and supports cursor-based pull.
func NewMutationTransport ¶ added in v1.13.0
func NewMutationTransport(baseURL, token string) (*MutationTransport, error)
NewMutationTransport creates a MutationTransport. baseURL must be a valid http/https URL. BW6: Reuses validateBaseURL to reject empty/malformed URLs.
func (*MutationTransport) PullMutations ¶ added in v1.13.0
func (mt *MutationTransport) PullMutations(sinceSeq int64, limit int) (*PullMutationsResponse, error)
PullMutations fetches mutations from the cloud server since the given sequence. REQ-201: 404 → reason_code=server_unsupported; 401 → IsAuthFailure.
func (*MutationTransport) PushMutations ¶ added in v1.13.0
func (mt *MutationTransport) PushMutations(entries []MutationEntry) ([]int64, error)
PushMutations POSTs a batch of mutations to the cloud server. REQ-200: 404 → reason_code=server_unsupported; 401 → IsAuthFailure.
type PullMutationsResponse ¶
type PullMutationsResponse struct {
Mutations []PulledMutation `json:"mutations"`
HasMore bool `json:"has_more"`
LatestSeq int64 `json:"latest_seq"`
}
type PulledMutation ¶ added in v1.13.0
type PushMutationsResult ¶
type PushMutationsResult struct {
AcceptedSeqs []int64 `json:"accepted_seqs"`
}
type RemoteTransport ¶
type RemoteTransport struct {
// contains filtered or unexported fields
}
func NewRemoteTransport ¶
func NewRemoteTransport(baseURL, token, project string) (*RemoteTransport, error)
func (*RemoteTransport) PullMutations ¶
func (rt *RemoteTransport) PullMutations(_ int64, _ int) (*PullMutationsResponse, error)
func (*RemoteTransport) PushMutations ¶
func (rt *RemoteTransport) PushMutations(_ []MutationEntry) (*PushMutationsResult, error)
func (*RemoteTransport) ReadChunk ¶
func (rt *RemoteTransport) ReadChunk(chunkID string) ([]byte, error)
func (*RemoteTransport) ReadManifest ¶
func (rt *RemoteTransport) ReadManifest() (*engramsync.Manifest, error)
func (*RemoteTransport) WriteChunk ¶
func (rt *RemoteTransport) WriteChunk(chunkID string, data []byte, entry engramsync.ChunkEntry) error
func (*RemoteTransport) WriteManifest ¶
func (rt *RemoteTransport) WriteManifest(_ *engramsync.Manifest) error