Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) Close()
- func (c *Client) CreateSnapshot(ctx context.Context, name string, projectName string, srcVolUUID guuid.UUID, ...) (*lb.Snapshot, error)
- func (c *Client) CreateVolume(ctx context.Context, name string, capacity uint64, replicaCount uint32, ...) (*lb.Volume, error)
- func (c *Client) DeleteSnapshot(ctx context.Context, uuid guuid.UUID, projectName string, blocking bool) error
- func (c *Client) DeleteVolume(ctx context.Context, uuid guuid.UUID, projectName string, blocking bool) error
- func (c *Client) GetCluster(ctx context.Context) (*lb.Cluster, error)
- func (c *Client) GetClusterInfo(ctx context.Context) (*lb.ClusterInfo, error)
- func (c *Client) GetSnapshot(ctx context.Context, uuid guuid.UUID, projectName string) (*lb.Snapshot, error)
- func (c *Client) GetSnapshotByName(ctx context.Context, name string, projectName string) (*lb.Snapshot, error)
- func (c *Client) GetVolume(ctx context.Context, uuid guuid.UUID, projectName string) (*lb.Volume, error)
- func (c *Client) GetVolumeByName(ctx context.Context, name string, projectName string) (*lb.Volume, error)
- func (c *Client) ID() string
- func (c *Client) ListNodes(ctx context.Context) ([]*lb.Node, error)
- func (c *Client) RemoteOk(ctx context.Context) error
- func (c *Client) Targets() string
- func (c *Client) UpdateVolume(ctx context.Context, uuid guuid.UUID, projectName string, ...) (*lb.Volume, error)
Constants ¶
const (
MaxReplicaCount = 128 // arbitrary, but sensible
)
Variables ¶
var ( CreateRetryOpts = wait.Backoff{ Delay: 250 * time.Millisecond, Factor: 2.0, DelayLimit: 2 * time.Second, Retries: 8, } DeleteRetryOpts = wait.Backoff{ Delay: 200 * time.Millisecond, Factor: 2.0, DelayLimit: 1 * time.Second, Retries: 15, } UpdateRetryOpts = wait.Backoff{ Delay: 250 * time.Millisecond, Factor: 1.5, DelayLimit: 1 * time.Second, Retries: 15, } )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func Dial ¶
func Dial( ctx context.Context, log *logrus.Entry, targets endpoint.Slice, mgmtScheme string, ) (*Client, error)
Dial() creates a LightOS cluster client. it is a blocking call and will only return once the connection to [at least one of the] `targets` has been actually established - subject to `ctx` limitations. if `ctx` specified timeout or duration - dialling (and only dialling!) timeout will be set accordingly. `ctx` can also be used to cancel the dialling process, as per usual.
the cluster client will make an effort to transparently reconnect to one of the `targets` in case of connection loss. if the process of finding a live and responsive target amongst `targets` and establishing the connection takes longer than the actual operation context timeout (as opposed to the `ctx` passed here) - `DeadlineExceeded` will be returned as usual, and the caller can retry the operation.
func (*Client) CreateSnapshot ¶
func (*Client) CreateVolume ¶
func (*Client) DeleteSnapshot ¶
func (*Client) DeleteVolume ¶
func (*Client) GetClusterInfo ¶
func (*Client) GetSnapshot ¶
func (*Client) GetSnapshotByName ¶
func (*Client) GetVolumeByName ¶
func (*Client) UpdateVolume ¶
func (c *Client) UpdateVolume( ctx context.Context, uuid guuid.UUID, projectName string, hook lb.VolumeUpdateHook, ) (*lb.Volume, error)
UpdateVolume() attempts to *overwrite* the fields of the volume specified by `uuid` with non-nil/default fields of `update` return value of the `hook`, see VolumeUpdateHook docs for details. it handles verifying that the update successfully completed and handles some of the common errors (such as retrying on codes.Unavailable, concurrent racing updates, etc.) internally, but delegates the higher-level application logic to the `hook`.