Documentation ¶
Index ¶
- Constants
- type BTFSDockerDriver
- func (m *BTFSDockerDriver) Capabilities() *volume.CapabilitiesResponse
- func (m *BTFSDockerDriver) Create(request *volume.CreateRequest) error
- func (m *BTFSDockerDriver) Get(request *volume.GetRequest) (*volume.GetResponse, error)
- func (m *BTFSDockerDriver) List() (*volume.ListResponse, error)
- func (m *BTFSDockerDriver) Mount(request *volume.MountRequest) (*volume.MountResponse, error)
- func (m *BTFSDockerDriver) Path(request *volume.PathRequest) (*volume.PathResponse, error)
- func (m *BTFSDockerDriver) Remove(request *volume.RemoveRequest) error
- func (m *BTFSDockerDriver) Unmount(request *volume.UnmountRequest) error
- type BTFSDockerVolume
- type BTFSDriver
- type BTFSVolume
- type Mount
- type Option
- type Permission
- type Volume
- type VolumeDriver
- type VolumeServer
Constants ¶
const ( BTFSDriverName = "btfs" BTFSImage = "sonm/btfs@sha256:b64b4a7849aa742049b039aeabcaff0fa58876c00df9abdf0321d3fff31789a2" DefaultDockerRootDirectory = volume.DefaultDockerRootDirectory )
const ( OptionNetworkName = "NetworkName" OptionNetworkID = "NetworkID" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BTFSDockerDriver ¶ added in v0.4.8
type BTFSDockerDriver struct {
// contains filtered or unexported fields
}
BTFSDockerDriver is a Docker driver implementation for BTFS volume plugin.
func NewBTFSDockerDriver ¶ added in v0.4.8
func NewBTFSDockerDriver(client *docker.Client, log *zap.SugaredLogger) (*BTFSDockerDriver, error)
func (*BTFSDockerDriver) Capabilities ¶ added in v0.4.8
func (m *BTFSDockerDriver) Capabilities() *volume.CapabilitiesResponse
func (*BTFSDockerDriver) Create ¶ added in v0.4.8
func (m *BTFSDockerDriver) Create(request *volume.CreateRequest) error
func (*BTFSDockerDriver) Get ¶ added in v0.4.8
func (m *BTFSDockerDriver) Get(request *volume.GetRequest) (*volume.GetResponse, error)
func (*BTFSDockerDriver) List ¶ added in v0.4.8
func (m *BTFSDockerDriver) List() (*volume.ListResponse, error)
func (*BTFSDockerDriver) Mount ¶ added in v0.4.8
func (m *BTFSDockerDriver) Mount(request *volume.MountRequest) (*volume.MountResponse, error)
func (*BTFSDockerDriver) Path ¶ added in v0.4.8
func (m *BTFSDockerDriver) Path(request *volume.PathRequest) (*volume.PathResponse, error)
func (*BTFSDockerDriver) Remove ¶ added in v0.4.8
func (m *BTFSDockerDriver) Remove(request *volume.RemoveRequest) error
func (*BTFSDockerDriver) Unmount ¶ added in v0.4.8
func (m *BTFSDockerDriver) Unmount(request *volume.UnmountRequest) error
type BTFSDockerVolume ¶ added in v0.4.8
type BTFSDriver ¶ added in v0.4.8
type BTFSDriver struct {
// contains filtered or unexported fields
}
func NewBTFSDriver ¶ added in v0.4.8
func NewBTFSDriver(options ...Option) (*BTFSDriver, error)
func (*BTFSDriver) Close ¶ added in v0.4.8
func (m *BTFSDriver) Close() error
func (*BTFSDriver) CreateVolume ¶ added in v0.4.8
func (*BTFSDriver) RemoveVolume ¶ added in v0.4.8
func (m *BTFSDriver) RemoveVolume(name string) error
type BTFSVolume ¶ added in v0.4.8
func (*BTFSVolume) Configure ¶ added in v0.4.8
func (m *BTFSVolume) Configure(mnt Mount, cfg *container.HostConfig) error
type Mount ¶
type Mount struct { Source string Target string Permission Permission }
Mount describes mount settings.
type Option ¶
type Option func(options interface{}) error
Option specifies how a Docker plugin can be configured.
func WithLogger ¶ added in v0.4.8
func WithLogger(log *zap.SugaredLogger) Option
func WithOptions ¶
WithOptions constructs an option that forwards the given generic options to the plugin.
func WithPluginSocketDir ¶
WithPluginSocketDir constructs an option that specifies the plugin directory where Unix sockets live.
type Permission ¶
type Permission uint32
const ( RW Permission = iota RO )
func ParsePermission ¶
func ParsePermission(mode string) (Permission, error)
type Volume ¶
type Volume interface { // Configure mutates the specified host config applying required settings. Configure(mount Mount, cfg *container.HostConfig) error }
Volume specifies volume interface, that is mounted within Docker containers.
type VolumeDriver ¶
type VolumeDriver interface { // CreateVolume creates a new volume using specified name and Option. // // This method is called before tuning a new container, so it should // prepare all required stuff such as mounting filesystems, create // subdirectories, etc. // For example for BTFS driver it creates torrent client, mounts FUSE // filesystem and tries to fetch the provided magnet URL. // // Both "name" and "options" parameters are passed directly from the // task specification. CreateVolume(name string, options map[string]string) (Volume, error) // RemoveVolume removes an existing volume. RemoveVolume(name string) error // Close closes this driver, freeing all associated resources. Close() error }
VolumeDriver specifies volume driver interface, providing abilities to create new volumes for containers.
func NewCIFSVolumeDriver ¶
func NewCIFSVolumeDriver(ctx context.Context, options ...Option) (VolumeDriver, error)
NewCIFSVolumeDriver constructs and runs a new CIFS volume driver within the provided error group.
func NewNilVolumeDriver ¶
func NewNilVolumeDriver() VolumeDriver
NewNilVolumeDriver constructs a new volume driver that does nothing.
Used primarily in systems that are unable to manage Docker plugins for to be able to at least start the Worker.
func NewVolumeDriver ¶
NewVolumeDriver constructs a new volume driver.
type VolumeServer ¶ added in v0.4.8
type VolumeServer struct {
// contains filtered or unexported fields
}
func NewVolumeServer ¶ added in v0.4.8
func NewVolumeServer(name string, options ...Option) (*VolumeServer, error)
func (*VolumeServer) Close ¶ added in v0.4.8
func (m *VolumeServer) Close() error