storage

package
v0.0.0-...-1c5d739 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 16 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClientNotInitialized = errors.New("storage client not initialized")
View Source
var (
	ZkStorageClientsPath = "/storage/clients"
)

Functions

This section is empty.

Types

type Client

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

Client is a storage client that manges discovering and mounting filesystems

func GetClient

func GetClient() (*Client, error)

func NewClient

func NewClient(host *host.Host, localPath string) (*Client, error)

NewClient returns a Client that manages remote mounts

func (*Client) Close

func (c *Client) Close()

Close informs this client to shutdown its current operations.

func (*Client) Mount

func (c *Client) Mount(source, destination string) error

Mount source to local destination path. The source is relative to the exported path

func (*Client) Unmount

func (c *Client) Unmount(destination string) error

func (*Client) Wait

func (c *Client) Wait() string

Wait will block until the client is Closed() or it has mounted the remote filesystem

type Node

type Node struct {
	host.Host
	Network    string
	ExportPath string
	ExportTime string
	// contains filtered or unexported fields
}

Node is a server that participate in serviced storage as a server or client

func (*Node) SetVersion

func (n *Node) SetVersion(version interface{})

SetVersion sets the node version to implement the client.Node interface

func (*Node) Version

func (n *Node) Version() interface{}

Version returns the node version to implement the client.Node interface

type Server

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

Server manages the exporting of a file system to clients.

func NewServer

func NewServer(driver StorageDriver, host *host.Host, volumesPath string) (*Server, error)

NewServer returns a Server object to manage the exported file system

func (*Server) Run

func (s *Server) Run(shutdown <-chan interface{}, conn client.Connection) error

type StorageDriver

type StorageDriver interface {
	// ExportPath will be something like "serviced_volumes_v2"
	ExportPath() string
	// ExportNamePath() will be something like "/exports/serviced_volumes_v2"
	ExportNamePath() string
	SetClients(clients ...string)
	Sync() error
	//TODO: remove Restart and Stop
	Restart() error
	Stop() error
	// AddVolume notify storage driver that volume at path is available for sharing
	AddVolume(path string) error
	// RemoveVolume notify storage driver that volume at path is should not be shared
	RemoveVolume(path string) error
	// Get the backing device for a path
	GetDevice(path string) (uint64, error)
}

StorageDriver is an interface that storage subsystem must implement to be used by this packages Server implementation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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