Documentation ¶
Index ¶
- type AttrType
- type Attribute
- type Client
- func (c *Client) AddACL(ctx context.Context, uid, gid, rootUID, rootGID, path string, a *acl.Entry) error
- func (c *Client) Chmod(ctx context.Context, uid, gid, mode, path string) error
- func (c *Client) Chown(ctx context.Context, uid, gid, chownUID, chownGID, path string) error
- func (c *Client) CreateDir(ctx context.Context, uid, gid, path string) error
- func (c *Client) GetACL(ctx context.Context, uid, gid, path, aclType, target string) (*acl.Entry, error)
- func (c *Client) GetFileInfoByInode(ctx context.Context, uid, gid string, inode uint64) (*FileInfo, error)
- func (c *Client) GetFileInfoByPath(ctx context.Context, uid, gid, path string) (*FileInfo, error)
- func (c *Client) GetQuota(ctx context.Context, username, rootUID, rootGID, path string) (*QuotaInfo, error)
- func (c *Client) List(ctx context.Context, uid, gid, path string) ([]*FileInfo, error)
- func (c *Client) ListACLs(ctx context.Context, uid, gid, path string) ([]*acl.Entry, error)
- func (c *Client) ListDeletedEntries(ctx context.Context, uid, gid string) ([]*DeletedEntry, error)
- func (c *Client) ListVersions(ctx context.Context, uid, gid, p string) ([]*FileInfo, error)
- func (c *Client) PurgeDeletedEntries(ctx context.Context, uid, gid string) error
- func (c *Client) Read(ctx context.Context, uid, gid, path string) (io.ReadCloser, error)
- func (c *Client) ReadVersion(ctx context.Context, uid, gid, p, version string) (io.ReadCloser, error)
- func (c *Client) Remove(ctx context.Context, uid, gid, path string) error
- func (c *Client) RemoveACL(ctx context.Context, uid, gid, rootUID, rootGID, path string, a *acl.Entry) error
- func (c *Client) Rename(ctx context.Context, uid, gid, oldPath, newPath string) error
- func (c *Client) RestoreDeletedEntry(ctx context.Context, uid, gid, key string) error
- func (c *Client) RollbackToVersion(ctx context.Context, uid, gid, path, version string) error
- func (c *Client) SetAttr(ctx context.Context, uid, gid string, attr *Attribute, recursive bool, ...) error
- func (c *Client) Touch(ctx context.Context, uid, gid, path string) error
- func (c *Client) UnsetAttr(ctx context.Context, uid, gid string, attr *Attribute, path string) error
- func (c *Client) UpdateACL(ctx context.Context, uid, gid, rootUID, rootGID, path string, a *acl.Entry) error
- func (c *Client) Write(ctx context.Context, uid, gid, path string, stream io.ReadCloser) error
- func (c *Client) WriteFile(ctx context.Context, uid, gid, path, source string) error
- type DeletedEntry
- type FileInfo
- type Options
- type QuotaInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttrType ¶ added in v0.0.2
type AttrType uint32
AttrType is the type of extended attribute, either system (sys) or user (user).
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 (*Client) AddACL ¶
func (c *Client) AddACL(ctx context.Context, uid, gid, rootUID, rootGID, path string, a *acl.Entry) error
AddACL adds an new acl to EOS with the given aclType.
func (*Client) GetACL ¶
func (c *Client) GetACL(ctx context.Context, uid, gid, path, aclType, target string) (*acl.Entry, error)
GetACL for a file
func (*Client) GetFileInfoByInode ¶
func (c *Client) GetFileInfoByInode(ctx context.Context, uid, gid string, inode uint64) (*FileInfo, error)
GetFileInfoByInode returns the FileInfo by the given inode
func (*Client) GetFileInfoByPath ¶
GetFileInfoByPath returns the FilInfo at the given path
func (*Client) GetQuota ¶
func (c *Client) GetQuota(ctx context.Context, username, rootUID, rootGID, path string) (*QuotaInfo, error)
GetQuota gets the quota of a user on the quota node defined by path
func (*Client) ListACLs ¶
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) ListDeletedEntries ¶
ListDeletedEntries returns a list of the deleted entries.
func (*Client) ListVersions ¶
ListVersions list all the versions for a given file.
func (*Client) PurgeDeletedEntries ¶
PurgeDeletedEntries purges all entries from the recycle bin.
func (*Client) ReadVersion ¶
func (c *Client) ReadVersion(ctx context.Context, uid, gid, p, version string) (io.ReadCloser, error)
ReadVersion reads the version for the given file.
func (*Client) RemoveACL ¶
func (c *Client) RemoveACL(ctx context.Context, uid, gid, rootUID, rootGID, path string, a *acl.Entry) error
RemoveACL removes the acl from EOS.
func (*Client) RestoreDeletedEntry ¶
RestoreDeletedEntry restores a deleted entry.
func (*Client) RollbackToVersion ¶
RollbackToVersion rollbacks a file to a previous version.
func (*Client) SetAttr ¶ added in v0.1.0
func (c *Client) SetAttr(ctx context.Context, uid, gid string, attr *Attribute, recursive bool, path string) error
SetAttr sets an extended attributes on a path.
func (*Client) UnsetAttr ¶ added in v0.1.0
func (c *Client) UnsetAttr(ctx context.Context, uid, gid string, attr *Attribute, path string) error
UnsetAttr unsets an extended attribute on a path.
func (*Client) UpdateACL ¶
func (c *Client) UpdateACL(ctx context.Context, uid, gid, rootUID, rootGID, path string, a *acl.Entry) error
UpdateACL updates the EOS acl.
type DeletedEntry ¶
type DeletedEntry struct { RestorePath string RestoreKey string Size uint64 DeletionMTime uint64 IsDir bool }
DeletedEntry represents an entry from the trashbin.
type FileInfo ¶
type FileInfo struct { IsDir bool MTimeNanos uint32 Inode uint64 `json:"inode"` FID uint64 `json:"fid"` UID uint64 `json:"uid"` GID uint64 `json:"gid"` TreeSize uint64 `json:"tree_size"` MTimeSec uint64 `json:"mtime_sec"` Size uint64 `json:"size"` TreeCount uint64 `json:"tree_count"` File string `json:"eos_file"` ETag string `json:"etag"` Instance string `json:"instance"` SysACL string `json:"sys_acl"` Attrs map[string]string `json:"attrs"` }
FileInfo represents the metadata information returned by querying the EOS namespace.
type Options ¶
type Options struct { // ForceSingleUserMode forces all connections to use only one user. // This is the case when access to EOS is done from FUSE under apache or www-data. ForceSingleUserMode bool // UseKeyTabAuth changes will authenticate requests by using an EOS keytab. UseKeytab 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 /usr/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" SecProtocol string }
Options to configure the Client.