Documentation ¶
Index ¶
- type BackupClient
- func (c *BackupClient) FetchSnapshot(ctx context.Context, name string) (io.ReadCloser, error)
- func (c *BackupClient) Open() (err error)
- func (c *BackupClient) PosMap(ctx context.Context) (map[string]ltx.Pos, error)
- func (c *BackupClient) URL() string
- func (c *BackupClient) WriteTx(ctx context.Context, name string, r io.Reader) (hwm ltx.TXID, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackupClient ¶
type BackupClient struct { // Name of cluster to replicate as. // This is typically set on the auth token and does not need to be set manually. Cluster string // Authentication field passed in via the "Authorization" HTTP header. AuthToken string HTTPClient *http.Client // contains filtered or unexported fields }
BackupClient implements a backup client for LiteFS Cloud.
func NewBackupClient ¶
func NewBackupClient(store *litefs.Store, u url.URL) *BackupClient
NewBackupClient returns a new instance of BackupClient.
func (*BackupClient) FetchSnapshot ¶
func (c *BackupClient) FetchSnapshot(ctx context.Context, name string) (io.ReadCloser, error)
FetchSnapshot requests a full snapshot of the database as it exists on the backup service. This should be used if the LiteFS node has become out of sync with the backup service.
func (*BackupClient) Open ¶
func (c *BackupClient) Open() (err error)
Open validates the URL the client was initialized with.
func (*BackupClient) PosMap ¶
PosMap returns the replication position for all databases on the backup service.
func (*BackupClient) WriteTx ¶
func (c *BackupClient) WriteTx(ctx context.Context, name string, r io.Reader) (hwm ltx.TXID, err error)
WriteTx writes an LTX file to the backup service. The file must be contiguous with the latest LTX file on the backup service or else it will return an ltx.PosMismatchError.
Click to show internal directories.
Click to hide internal directories.