lfsc

package
v0.5.11 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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

func (c *BackupClient) PosMap(ctx context.Context) (map[string]ltx.Pos, error)

PosMap returns the replication position for all databases on the backup service.

func (*BackupClient) URL

func (c *BackupClient) URL() string

URL of 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.

Jump to

Keyboard shortcuts

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