eosclient

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2018 License: AGPL-3.0 Imports: 17 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 {
	// contains filtered or unexported fields
}

Client performs actions against a EOS management node (MGM). It requires the eos-client and xrootd-client packages installed to work.

func New

func New(opt *Options) (*Client, error)

func (*Client) AddACL

func (c *Client) AddACL(ctx context.Context, username, path string, readOnly bool, recipient *api.ShareRecipient, shareList []*api.FolderShare) error

func (*Client) CreateDir

func (c *Client) CreateDir(ctx context.Context, username, path string) error

CreateDir creates a directory at the given path

func (*Client) GetFileInfoByInode

func (c *Client) GetFileInfoByInode(ctx context.Context, username string, inode uint64) (*FileInfo, error)

GetFileInfoByInode returns the FileInfo by the given inode

func (*Client) GetFileInfoByPath

func (c *Client) GetFileInfoByPath(ctx context.Context, username, path string) (*FileInfo, error)

GetFileInfoByPath returns the FilInfo at the given path

func (*Client) GetQuota added in v0.0.2

func (c *Client) GetQuota(ctx context.Context, username, path string) (int, int, error)

GetQuota gets the quota of a user on the quota node defined by path

func (*Client) List

func (c *Client) List(ctx context.Context, username, path string) ([]*FileInfo, error)

List the contents of the directory given by path

func (*Client) ListDeletedEntries

func (c *Client) ListDeletedEntries(ctx context.Context, username string) ([]*DeletedEntry, error)

ListDeletedEntries returns a list of the deleted entries.

func (*Client) ListVersions

func (c *Client) ListVersions(ctx context.Context, username, p string) ([]*FileInfo, error)

ListVersions list all the versions for a given file.

func (*Client) PurgeDeletedEntries

func (c *Client) PurgeDeletedEntries(ctx context.Context, username string) error

PurgeDeletedEntries purges all entries from the recycle bin.

func (*Client) Read

func (c *Client) Read(ctx context.Context, username, path string) (io.ReadCloser, error)

Read reads a file from the mgm

func (*Client) ReadVersion

func (c *Client) ReadVersion(ctx context.Context, username, p, version string) (io.ReadCloser, error)

ReadVersion reads the version for the given file.

func (*Client) Remove

func (c *Client) Remove(ctx context.Context, username, path string) error

Remove removes the resource at the given path

func (*Client) RemoveACL

func (c *Client) RemoveACL(ctx context.Context, username, path string, recipient *api.ShareRecipient, shareList []*api.FolderShare) error

func (*Client) Rename

func (c *Client) Rename(ctx context.Context, username, oldPath, newPath string) error

Rename renames the resource referenced by oldPath to newPath

func (*Client) RestoreDeletedEntry

func (c *Client) RestoreDeletedEntry(ctx context.Context, username, key string) error

RestoreDeletedEntry restores a deleted entry.

func (*Client) RollbackToVersion

func (c *Client) RollbackToVersion(ctx context.Context, username, path, version string) error

RollbackToVersion rollbacks a file to a previous version.

func (*Client) UpdateACL

func (c *Client) UpdateACL(ctx context.Context, username, path string, readOnly bool, recipient *api.ShareRecipient, shareList []*api.FolderShare) error

func (*Client) Write

func (c *Client) Write(ctx context.Context, username, path string, stream io.ReadCloser) error

Write writes a file to the mgm

type DeletedEntry

type DeletedEntry struct {
	RestorePath   string
	RestoreKey    string
	Size          uint64
	DeletionMTime uint64
	IsDir         bool
}

type FileInfo

type FileInfo struct {
	File      string `json:"eos_file"`
	Inode     uint64 `json:"inode"`
	FID       uint64 `json:"fid"`
	ETag      string
	TreeSize  uint64
	MTime     uint64
	Size      uint64
	IsDir     bool
	Instance  string
	SysACL    string
	TreeCount uint64
	UID       string
	GID       string
	CTime     uint64
}

type Options

type Options struct {
	// Location of the eos binary.
	// Default is /usr/bin/eos.
	EosBinary string

	// Location of the xrdcopy binary.
	// Default is /usr/bin/xrdcopy.
	XrdcopyBinary string

	// URL of the EOS MGM.
	// Default is root://eos-test.org
	URL string

	// Location on the local fs where to store reads.
	// Defaults to os.TempDir()
	CacheDirectory string

	// Enables logging of the commands executed
	// Defaults to false
	EnableLogging bool

	// Logger to use
	Logger *zap.Logger
}

Jump to

Keyboard shortcuts

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