Help us shape the future of Go! Take the 2026 Go Developer Survey

provisionclient

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package provisionclient is how `fileshare serve` talks to `fileshare provisioner`: a unix socket, typed calls, and nothing that could carry a path. See proto/fileshare/provision/v1/provision.proto for what each call promises, and the status codes it answers with.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a connection to a provisioner. It is safe for concurrent use; the provisioner serializes the changes itself.

func Dial

func Dial(socket string, opts ...Option) (*Client, error)

Dial prepares a connection to the provisioner on socket, which is "unix:///path" or an absolute path. Like grpc.NewClient it does not connect: the first call does, and fails if nothing answers.

func (*Client) Capabilities

Capabilities lists the parents and the limits.

func (*Client) Close

func (c *Client) Close() error

Close closes the connection.

func (*Client) Conn

func (c *Client) Conn() *grpc.ClientConn

Conn is the underlying connection, for a caller that needs the raw service -- or, in a test, a method the provisioner does not have.

func (*Client) Create

func (c *Client) Create(ctx context.Context, parent, name string, quota uint64) (v *provisionv1.Volume, created bool, err error)

Create creates parent/name with quota bytes, or answers with the volume that exists with that quota already (created false).

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, parent, name string, destroyData bool) (deleted bool, err error)

Delete deletes a volume; deleted is false when there was none. Without destroyData a volume holding data or snapshots is refused.

func (*Client) Get

func (c *Client) Get(ctx context.Context, parent, name string) (*provisionv1.Volume, error)

Get returns one volume.

func (*Client) List

func (c *Client) List(ctx context.Context, parent string) ([]*provisionv1.Volume, error)

List returns the volumes of parent, or of every parent when it is "".

func (*Client) Resize

func (c *Client) Resize(ctx context.Context, parent, name string, quota uint64) (*provisionv1.Volume, error)

Resize changes a volume's quota.

func (*Client) Snapshot

func (c *Client) Snapshot(ctx context.Context, parent, name, snapshot string) (v *provisionv1.Volume, created bool, err error)

Snapshot takes a read-only snapshot of a ZFS or btrfs volume.

type Option

type Option func(*options)

An Option changes how Dial connects.

func ServerUID

func ServerUID(uid uint32) Option

ServerUID refuses a socket where something other than uid answers. A provisioner normally runs as root, and the socket's directory is root's; this is the check that does not depend on either.

func WithDialOption

func WithDialOption(d grpc.DialOption) Option

WithDialOption passes a gRPC dial option through, for the tests.

Jump to

Keyboard shortcuts

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