remote

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

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) IsRepairableMigrationFailure added in v1.13.0

func (e *HTTPStatusError) IsRepairableMigrationFailure() bool

type MutationEntry

type MutationEntry struct {
	Project   string          `json:"project"`
	Entity    string          `json:"entity"`
	EntityKey string          `json:"entity_key"`
	Op        string          `json:"op"`
	Payload   json.RawMessage `json:"payload"`
}

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 PulledMutation struct {
	Seq        int64           `json:"seq"`
	Entity     string          `json:"entity"`
	EntityKey  string          `json:"entity_key"`
	Op         string          `json:"op"`
	Payload    json.RawMessage `json:"payload"`
	OccurredAt string          `json:"occurred_at"`
}

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

Jump to

Keyboard shortcuts

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