Documentation ¶
Index ¶
- Constants
- 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) GetFileInfoByFXID(ctx context.Context, uid, gid string, fxid string) (*eosclient.FileInfo, error)
- func (c *Client) GetFileInfoByInode(ctx context.Context, uid, gid string, inode uint64) (*eosclient.FileInfo, error)
- func (c *Client) GetFileInfoByPath(ctx context.Context, uid, gid, path string) (*eosclient.FileInfo, error)
- func (c *Client) GetHTTPCl() *ehttp.Client
- func (c *Client) GetQuota(ctx context.Context, username, rootUID, rootGID, path string) (*eosclient.QuotaInfo, error)
- func (c *Client) List(ctx context.Context, uid, gid, dpath string) ([]*eosclient.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) ([]*eosclient.DeletedEntry, error)
- func (c *Client) ListVersions(ctx context.Context, uid, gid, p string) ([]*eosclient.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 *eosclient.Attribute, ...) error
- func (c *Client) SetQuota(ctx context.Context, rootUID, rootGID string, info *eosclient.SetQuotaInfo) error
- func (c *Client) Touch(ctx context.Context, uid, gid, path string) error
- func (c *Client) UnsetAttr(ctx context.Context, uid, gid string, attr *eosclient.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 Options
Constants ¶
const ( // SystemAttr is the system extended attribute. SystemAttr eosclient.AttrType = iota // UserAttr is the user extended attribute. UserAttr )
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) using the EOS GRPC interface.
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) GetFileInfoByFXID ¶
func (c *Client) GetFileInfoByFXID(ctx context.Context, uid, gid string, 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, uid, gid string, inode uint64) (*eosclient.FileInfo, error)
GetFileInfoByInode returns the FileInfo by the given inode
func (*Client) GetFileInfoByPath ¶
func (c *Client) GetFileInfoByPath(ctx context.Context, uid, gid, path string) (*eosclient.FileInfo, error)
GetFileInfoByPath returns the FilInfo at the given path
func (*Client) GetHTTPCl ¶ added in v1.8.1
GetHTTPCl creates an http client for immediate usage, using the already instantiated resources
func (*Client) GetQuota ¶
func (c *Client) GetQuota(ctx context.Context, username, rootUID, rootGID, path string) (*eosclient.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 ¶
func (c *Client) ListDeletedEntries(ctx context.Context, uid, gid string) ([]*eosclient.DeletedEntry, error)
ListDeletedEntries returns a list of the deleted entries.
func (*Client) ListVersions ¶
func (c *Client) ListVersions(ctx context.Context, uid, gid, p string) ([]*eosclient.FileInfo, error)
ListVersions list all the versions for a given file.
func (*Client) PurgeDeletedEntries ¶
PurgeDeletedEntries purges all entries from the recycle bin.
func (*Client) Read ¶
Read reads a file from the mgm and returns a handle to read it This handle could be directly the body of the response or a local tmp file
returning a handle to the body is nice, yet it gives less control on the transaction itself, e.g. strange timeouts or TCP issues may be more difficult to trace
Let's consider this experimental for the moment, maybe I'll like to add a config parameter to choose between the two behaviours
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 ¶
func (c *Client) SetAttr(ctx context.Context, uid, gid string, attr *eosclient.Attribute, recursive bool, path string) error
SetAttr sets an extended attributes on a path.
func (*Client) SetQuota ¶
func (c *Client) SetQuota(ctx context.Context, rootUID, rootGID string, info *eosclient.SetQuotaInfo) error
SetQuota sets the quota of a user on the quota node defined by path
func (*Client) UnsetAttr ¶
func (c *Client) UnsetAttr(ctx context.Context, uid, gid string, attr *eosclient.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 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 // Set to true to use the local disk as a buffer for chunk // reads from EOS. Default is false, i.e. pure streaming ReadUsesLocalTemp bool // Set to true to use the local disk as a buffer for chunk // writes to EOS. Default is false, i.e. pure streaming // Beware: in pure streaming mode the FST must support // the HTTP chunked encoding WriteUsesLocalTemp bool // 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 // URI of the EOS MGM grpc server GrpcURI 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 // Authkey is the key that authorizes this client to connect to the GRPC service // It's unclear whether this will be the final solution Authkey string // SecProtocol is the comma separated list of security protocols used by xrootd. // For example: "sss, unix" SecProtocol string // HTTP connections to EOS: max number of idle conns MaxIdleConns int // HTTP connections to EOS: max number of conns per host MaxConnsPerHost int // HTTP connections to EOS: max number of idle conns per host MaxIdleConnsPerHost int // HTTP connections to EOS: idle conections TTL IdleConnTimeout int }
Options to configure the Client.