eosbinary

package
v3.10.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: Apache-2.0 Imports: 22 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)

New creates a new client with the given options.

func (*Client) AddACL

func (c *Client) AddACL(ctx context.Context, auth eosclient.Authorization, path string, pos uint, a *acl.Entry, recursive bool) error

AddACL adds an new acl to EOS with the given aclType.

func (*Client) Chmod

func (c *Client) Chmod(ctx context.Context, auth eosclient.Authorization, mode, path string) error

Chmod given path.

func (*Client) Chown

func (c *Client) Chown(ctx context.Context, auth, chownauth eosclient.Authorization, path string) error

Chown given path.

func (*Client) CreateDir

func (c *Client) CreateDir(ctx context.Context, auth eosclient.Authorization, path string) error

CreateDir creates a directory at the given path.

func (*Client) GenerateToken

func (c *Client) GenerateToken(ctx context.Context, auth eosclient.Authorization, p string, a *acl.Entry) (string, error)

GenerateToken returns a token on behalf of the resource owner to be used by lightweight accounts.

func (*Client) GetACL

func (c *Client) GetACL(ctx context.Context, auth eosclient.Authorization, path, aclType, target string) (*acl.Entry, error)

GetACL for a file.

func (*Client) GetAttr

func (c *Client) GetAttr(ctx context.Context, auth eosclient.Authorization, key, path string) (*eosclient.Attribute, error)

GetAttr returns the attribute specified by key.

func (*Client) GetAttrs

func (c *Client) GetAttrs(ctx context.Context, auth eosclient.Authorization, path string) ([]*eosclient.Attribute, error)

GetAttrs returns all the attributes of a resource.

func (*Client) GetFileInfoByFXID

func (c *Client) GetFileInfoByFXID(ctx context.Context, auth eosclient.Authorization, fxid string) (*eosclient.FileInfo, error)

GetFileInfoByFXID returns the FileInfo by the given file id in hexadecimal.

func (*Client) GetFileInfoByInode

func (c *Client) GetFileInfoByInode(ctx context.Context, auth eosclient.Authorization, inode uint64) (*eosclient.FileInfo, error)

GetFileInfoByInode returns the FileInfo by the given inode.

func (*Client) GetFileInfoByPath

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

GetFileInfoByPath returns the FilInfo at the given path.

func (*Client) GetQuota

func (c *Client) GetQuota(ctx context.Context, user eosclient.Authorization, rootAuth eosclient.Authorization, path string) (*eosclient.QuotaInfo, 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, auth eosclient.Authorization, path string) ([]*eosclient.FileInfo, error)

List the contents of the directory given by path.

func (*Client) ListACLs

func (c *Client) ListACLs(ctx context.Context, auth eosclient.Authorization, path string) ([]*acl.Entry, error)

ListACLs returns the list of ACLs present under the given path. EOS returns uids/gid for Citrine version and usernames for older versions. For Citire we need to convert back the uid back to username.

func (*Client) ListAllQuota added in v3.6.2

ListAllQuota is not supported by the binary client.

func (*Client) ListDeletedEntries

func (c *Client) ListDeletedEntries(ctx context.Context, auth eosclient.Authorization, recycleid string, maxentries int, from, to time.Time) ([]*eosclient.DeletedEntry, error)

ListDeletedEntries returns a list of the deleted entries.

func (*Client) ListVersions

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

ListVersions list all the versions for a given file.

func (*Client) ListWithRegex

func (c *Client) ListWithRegex(ctx context.Context, auth eosclient.Authorization, path string, depth uint, regex string) ([]*eosclient.FileInfo, error)

func (*Client) PurgeDeletedEntries

func (c *Client) PurgeDeletedEntries(ctx context.Context, recycleid string, auth eosclient.Authorization, entries []string) error

PurgeDeletedEntries purges all entries from the recycle bin.

func (*Client) Read

func (c *Client) Read(ctx context.Context, auth eosclient.Authorization, path string, ranges []storage.Range) (io.ReadCloser, error)

Read reads a file from the mgm.

func (*Client) ReadVersion

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

ReadVersion reads the version for the given file.

func (*Client) Remove

func (c *Client) Remove(ctx context.Context, auth eosclient.Authorization, path string, noRecycle bool) error

Remove removes the resource at the given path.

func (*Client) RemoveACL

func (c *Client) RemoveACL(ctx context.Context, auth eosclient.Authorization, path string, a *acl.Entry, recursive bool) error

RemoveACL removes the acl from EOS.

func (*Client) Rename

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

Rename renames the resource referenced by oldPath to newPath.

func (*Client) RestoreDeletedEntry

func (c *Client) RestoreDeletedEntry(ctx context.Context, auth eosclient.Authorization, key string) error

RestoreDeletedEntry restores a deleted entry.

func (*Client) RollbackToVersion

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

RollbackToVersion rollbacks a file to a previous version.

func (*Client) SetAttr

func (c *Client) SetAttr(ctx context.Context, auth eosclient.Authorization, attr *eosclient.Attribute, errorIfExists, recursive bool, path, app string) error

SetAttr sets an extended attribute on the exact path given. Routing of file xattrs to the version folder is decided by the eosfs layer, not here.

func (*Client) SetQuota

SetQuota sets the quota of a user on the quota node defined by path.

func (*Client) Touch

func (c *Client) Touch(ctx context.Context, auth eosclient.Authorization, path string) error

Touch creates a 0-size,0-replica file in the EOS namespace.

func (*Client) UnsetAttr

func (c *Client) UnsetAttr(ctx context.Context, auth eosclient.Authorization, attr *eosclient.Attribute, recursive bool, path, app string) error

UnsetAttr unsets an extended attribute on the exact path given. Routing of file xattrs to the version folder is decided by the eosfs layer, not here.

func (*Client) UpdateACL

func (c *Client) UpdateACL(ctx context.Context, auth eosclient.Authorization, path string, position uint, a *acl.Entry, recursive bool) error

UpdateACL updates the EOS acl.

func (*Client) Write

func (c *Client) Write(ctx context.Context, auth eosclient.Authorization, path string, stream io.ReadCloser, length int64, app string, disableVersioning bool) error

Write writes a stream to the mgm.

type Options

type Options struct {
	// UseKeyTabAuth changes will authenticate requests by using an EOS keytab.
	UseKeytab bool

	// Whether to maintain the same inode across various versions of a file.
	// Requires extra metadata operations if set to true
	VersionInvariant bool

	// SingleUsername is the username to use when connecting to EOS.
	// Defaults to apache
	SingleUsername string

	// Location of the eos binary.
	// Default is /usr/bin/eos.
	EosBinary string

	// Location of the xrdcopy binary.
	// Default is /opt/eos/xrootd/bin/xrdcopy.
	XrdcopyBinary string

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

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

	// Keytab is the location of the EOS keytab file.
	Keytab string

	// SecProtocol is the comma separated list of security protocols used by xrootd.
	// For example: "sss, unix"
	// DEPRECATED
	// This variable is no longer used. Only sss and unix protocols are possible.
	// If UseKeytab is set to true the protocol will be set to "sss", else to "unix"
	SecProtocol string

	// TokenExpiry stores in seconds the time after which generated tokens will expire
	// Default is 3600
	TokenExpiry int
}

Options to configure the Client.

func (*Options) ApplyDefaults

func (opt *Options) ApplyDefaults()

Jump to

Keyboard shortcuts

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