mock

package
v0.4.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

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]litefs.Pos) (io.ReadCloser, error)
}

func (*Client) AcquireHaltLock added in v0.4.0

func (c *Client) AcquireHaltLock(ctx context.Context, primaryURL string, nodeID uint64, name string, lockID int64) (*litefs.HaltLock, error)

func (*Client) Commit added in v0.4.0

func (c *Client) Commit(ctx context.Context, primaryURL string, nodeID uint64, name string, lockID int64, r io.Reader) error

func (*Client) ReleaseHaltLock added in v0.4.0

func (c *Client) ReleaseHaltLock(ctx context.Context, primaryURL string, nodeID uint64, name string, lockID int64) error

func (*Client) Stream

func (c *Client) Stream(ctx context.Context, primaryURL string, nodeID uint64, posMap map[string]litefs.Pos) (io.ReadCloser, error)

type Lease

type Lease struct {
	IDFunc        func() string
	RenewedAtFunc func() time.Time
	TTLFunc       func() time.Duration
	RenewFunc     func(ctx context.Context) error
	HandoffFunc   func(nodeID uint64) error
	HandoffChFunc func() <-chan uint64
	CloseFunc     func() error
}

func (*Lease) Close

func (l *Lease) Close() error

func (*Lease) Handoff added in v0.4.0

func (l *Lease) Handoff(nodeID uint64) error

func (*Lease) HandoffCh added in v0.4.0

func (l *Lease) HandoffCh() <-chan uint64

func (*Lease) ID added in v0.4.0

func (l *Lease) ID() string

func (*Lease) Renew

func (l *Lease) Renew(ctx context.Context) error

func (*Lease) RenewedAt

func (l *Lease) RenewedAt() time.Time

func (*Lease) TTL

func (l *Lease) TTL() time.Duration

type Leaser

type Leaser struct {
	CloseFunc           func() error
	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)
}

func (*Leaser) Acquire

func (l *Leaser) Acquire(ctx context.Context) (litefs.Lease, error)

func (*Leaser) AcquireExisting added in v0.4.0

func (l *Leaser) AcquireExisting(ctx context.Context, leaseID string) (litefs.Lease, error)

func (*Leaser) AdvertiseURL

func (l *Leaser) AdvertiseURL() string

func (*Leaser) Close

func (l *Leaser) Close() error

func (*Leaser) PrimaryInfo

func (l *Leaser) PrimaryInfo(ctx context.Context) (litefs.PrimaryInfo, error)

Jump to

Keyboard shortcuts

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