Documentation
¶
Index ¶
- type Client
- func (c *Client) AcquireHaltLock(ctx context.Context, primaryURL string, nodeID uint64, name string, ...) (*litefs.HaltLock, error)
- func (c *Client) Commit(ctx context.Context, primaryURL string, nodeID uint64, name string, ...) error
- func (c *Client) ReleaseHaltLock(ctx context.Context, primaryURL string, nodeID uint64, name string, ...) error
- func (c *Client) Stream(ctx context.Context, primaryURL string, nodeID uint64, ...) (litefs.Stream, error)
- type Lease
- type Leaser
- func (l *Leaser) Acquire(ctx context.Context) (litefs.Lease, error)
- func (l *Leaser) AcquireExisting(ctx context.Context, leaseID string) (litefs.Lease, error)
- func (l *Leaser) AdvertiseURL() string
- func (l *Leaser) Close() error
- func (l *Leaser) ClusterID(ctx context.Context) (string, error)
- func (l *Leaser) Hostname() string
- func (l *Leaser) PrimaryInfo(ctx context.Context) (litefs.PrimaryInfo, error)
- func (l *Leaser) SetClusterID(ctx context.Context, clusterID string) error
- func (l *Leaser) Type() string
- type OS
- func (m *OS) Create(op, name string) (*os.File, error)
- func (m *OS) Mkdir(op, path string, perm os.FileMode) error
- func (m *OS) MkdirAll(op, path string, perm os.FileMode) error
- func (m *OS) Open(op, name string) (*os.File, error)
- func (m *OS) OpenFile(op, name string, flag int, perm os.FileMode) (*os.File, error)
- func (m *OS) ReadDir(op, name string) ([]os.DirEntry, error)
- func (m *OS) ReadFile(op, name string) ([]byte, error)
- func (m *OS) Remove(op, name string) error
- func (m *OS) RemoveAll(op, name string) error
- func (m *OS) Rename(op, oldpath, newpath string) error
- func (m *OS) Stat(op, name string) (os.FileInfo, error)
- func (m *OS) Truncate(op, name string, size int64) error
- func (m *OS) WriteFile(op, name string, data []byte, perm os.FileMode) error
- type Stream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
AcquireHaltLockFunc func(ctx context.Context, primaryURL string, nodeID uint64, name string, lockID int64) (*litefs.HaltLock, error)
ReleaseHaltLockFunc func(ctx context.Context, primaryURL string, nodeID uint64, name string, lockID int64) error
CommitFunc func(ctx context.Context, primaryURL string, nodeID uint64, name string, lockID int64, r io.Reader) error
StreamFunc func(ctx context.Context, primaryURL string, nodeID uint64, posMap map[string]ltx.Pos, filter []string) (litefs.Stream, error)
}
func (*Client) AcquireHaltLock ¶ added in v0.4.0
func (*Client) ReleaseHaltLock ¶ added in v0.4.0
type Lease ¶
type Lease struct {
IDFunc func() string
RenewedAtFunc func() time.Time
TTLFunc func() time.Duration
RenewFunc func(ctx context.Context) error
HandoffFunc func(ctx context.Context, nodeID uint64) error
HandoffChFunc func() <-chan uint64
CloseFunc func() error
}
type Leaser ¶
type Leaser struct {
CloseFunc func() error
HostnameFunc func() string
AdvertiseURLFunc func() string
AcquireFunc func(ctx context.Context) (litefs.Lease, error)
AcquireExistingFunc func(ctx context.Context, leaseID string) (litefs.Lease, error)
PrimaryInfoFunc func(ctx context.Context) (litefs.PrimaryInfo, error)
ClusterIDFunc func(ctx context.Context) (string, error)
SetClusterIDFunc func(ctx context.Context, clusterID string) error
}
func (*Leaser) AcquireExisting ¶ added in v0.4.0
func (*Leaser) AdvertiseURL ¶
func (*Leaser) PrimaryInfo ¶
func (*Leaser) SetClusterID ¶ added in v0.5.0
type OS ¶ added in v0.5.6
type OS struct {
Underlying litefs.OS
CreateFunc func(op, name string) (*os.File, error)
MkdirFunc func(op, path string, perm os.FileMode) error
MkdirAllFunc func(op, path string, perm os.FileMode) error
OpenFunc func(op, name string) (*os.File, error)
OpenFileFunc func(op, name string, flag int, perm os.FileMode) (*os.File, error)
ReadDirFunc func(op, name string) ([]os.DirEntry, error)
ReadFileFunc func(op, name string) ([]byte, error)
RemoveFunc func(op, name string) error
RemoveAllFunc func(op, name string) error
RenameFunc func(op, oldpath, newpath string) error
StatFunc func(op, name string) (os.FileInfo, error)
TruncateFunc func(op, name string, size int64) error
WriteFileFunc func(op, name string, data []byte, perm os.FileMode) error
}
func NewOS ¶ added in v0.5.6
func NewOS() *OS
NewOS returns a mock OS that defaults to using an underlying system OS.
Click to show internal directories.
Click to hide internal directories.