eosfs

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: Apache-2.0 Imports: 39 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// SystemAttr is the system extended attribute.
	SystemAttr eosclient.AttrType = iota
	// UserAttr is the user extended attribute.
	UserAttr
)

Variables

This section is empty.

Functions

func NewEOSFS

func NewEOSFS(ctx context.Context, c *Config) (storage.FS, error)

NewEOSFS returns a storage.FS interface implementation that connects to an EOS instance.

Types

type Config

type Config struct {
	// Namespace for metadata operations
	Namespace string `mapstructure:"namespace"`

	// QuotaNode for storing quota information
	QuotaNode string `mapstructure:"quota_node"`

	// Location of the eos binary.
	// Default is /usr/bin/eos.
	EosBinary string `mapstructure:"eos_binary"`

	// Location of the xrdcopy binary.
	// Default is /opt/eos/xrootd/bin/xrdcopy.
	XrdcopyBinary string `mapstructure:"xrdcopy_binary"`

	// URL of the Master EOS MGM.
	// Default is root://eos-example.org
	MasterURL string `mapstructure:"master_url"`

	// URL of the Slave EOS MGM.
	// Default is root://eos-example.org
	SlaveURL string `mapstructure:"slave_url"`

	// Location on the local fs where to store reads.
	// Defaults to os.TempDir()
	CacheDirectory string `mapstructure:"cache_directory"`

	// SecProtocol specifies the xrootd security protocol to use between the server and EOS.
	SecProtocol string `mapstructure:"sec_protocol"`

	// Keytab specifies the location of the keytab to use to authenticate to EOS.
	Keytab string `mapstructure:"keytab"`

	// SingleUsername is the username to use when SingleUserMode is enabled
	SingleUsername string `mapstructure:"single_username"`

	// UserLayout wraps the internal path with user information.
	// Example: if conf.Namespace is /eos/user and received path is /docs
	// and the UserLayout is {{.Username}} the internal path will be:
	// /eos/user/<username>/docs
	UserLayout string `mapstructure:"user_layout"`

	// Enables logging of the commands executed
	// Defaults to false
	EnableLogging bool `mapstructure:"enable_logging"`

	// ShowHiddenSysFiles shows internal EOS files like
	// .sys.v# and .sys.a# files.
	ShowHiddenSysFiles bool `mapstructure:"show_hidden_sys_files"`

	// ForceSingleUserMode will force connections to EOS to use SingleUsername
	ForceSingleUserMode bool `mapstructure:"force_single_user_mode"`

	// UseKeyTabAuth changes will authenticate requests by using an EOS keytab.
	UseKeytab bool `mapstructure:"use_keytab"`

	// TODO: what does this do??
	EnableHome bool `mapstructure:"enable_home"`

	// EnableHome enables the creation of home directories.
	EnableHomeCreation bool `mapstructure:"enable_home_creation"`

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

	// UseGRPC controls whether we spawn eosclient processes or use GRPC to connect to EOS.
	UseGRPC bool `mapstructure:"use_grpc"`

	// GatewaySvc stores the endpoint at which the GRPC gateway is exposed.
	GatewaySvc string `mapstructure:"gatewaysvc"`

	// GRPCAuthkey is the key that authorizes this client to connect to the EOS GRPC service
	GRPCAuthkey string `mapstructure:"grpc_auth_key"`

	// HTTPSAuthkey is the key that authorizes this client to connect to the EOS HTTPS service
	HTTPSAuthkey string `mapstructure:"https_auth_key"`

	// URI of the EOS MGM grpc server
	// Default is empty
	GrpcURI string `mapstructure:"master_grpc_uri"`

	// Size of the cache used to store user ID and UID resolution.
	// Default value is 1000000.
	UserIDCacheSize int `mapstructure:"user_id_cache_size"`

	// The depth, starting from root, that we'll parse directories to lookup the
	// owner and warm up the cache. For example, for a layout of {{substr 0 1 .Username}}/{{.Username}}
	// and a depth of 2, we'll lookup each user's home directory.
	// Default value is 2.
	UserIDCacheWarmupDepth int `mapstructure:"user_id_cache_warmup_depth"`

	// Normally the eosgrpc plugin streams data on the fly.
	// Setting this to true will make reva use the temp cachedirectory
	// as intermediate step for read operations
	ReadUsesLocalTemp bool `mapstructure:"read_uses_local_temp"`

	// Normally the eosgrpc plugin streams data on the fly.
	// Setting this to true will make reva use the temp cachedirectory
	// as intermediate step for write operations
	// Beware: in pure streaming mode the FST must support
	// the HTTP chunked encoding
	WriteUsesLocalTemp bool `mapstructure:"write_uses_local_temp"`

	// Whether to allow recycle operations on base paths.
	// If set to true, we'll look up the owner of the passed path and perform
	// operations on that user's recycle bin.
	// Only considered when EnableHome is false.
	AllowPathRecycleOperations bool `mapstructure:"allow_path_recycle_operations"`

	// HTTP connections to EOS: max number of idle conns
	MaxIdleConns int `mapstructure:"max_idle_conns"`

	// HTTP connections to EOS: max number of conns per host
	MaxConnsPerHost int `mapstructure:"max_conns_per_host"`

	// HTTP connections to EOS: max number of idle conns per host
	MaxIdleConnsPerHost int `mapstructure:"max_idle_conns_per_host"`

	// HTTP connections to EOS: idle conections TTL
	IdleConnTimeout int `mapstructure:"idle_conn_timeout"`

	// HTTP connections to EOS: client certificate (usually a X509 host certificate)
	ClientCertFile string `mapstructure:"http_client_certfile"`
	// HTTP connections to EOS: client certificate key (usually a X509 host certificate)
	ClientKeyFile string `mapstructure:"http_client_keyfile"`
	// HTTP connections to EOS: CA directories
	ClientCADirs string `mapstructure:"http_client_cadirs"`
	// HTTP connections to EOS: CA files
	ClientCAFiles string `mapstructure:"http_client_cafiles"`

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

	// Path of the script to run in order to create a user home folder
	// TODO(lopresti): to be replaced by a call to the Resource Lifecycle API being developed
	CreateHomeHook string `mapstructure:"create_home_hook"`

	// Maximum entries count a ListRecycle call may return: if exceeded, ListRecycle
	// will return a BadRequest error
	MaxRecycleEntries int `mapstructure:"max_recycle_entries"`

	// Maximum time span in days a ListRecycle call may return: if exceeded, ListRecycle
	// will override the "to" date with "from" + this value
	MaxDaysInRecycleList int `mapstructure:"max_days_in_recycle_list"`
}

Config holds the configuration details for the EOS fs.

func (*Config) ApplyDefaults

func (c *Config) ApplyDefaults()

type Eosfs

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

func (*Eosfs) AddGrant

func (fs *Eosfs) AddGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) error

func (*Eosfs) CreateDir

func (fs *Eosfs) CreateDir(ctx context.Context, ref *provider.Reference) error

func (*Eosfs) CreateHome

func (fs *Eosfs) CreateHome(ctx context.Context) error

func (*Eosfs) CreateReference

func (fs *Eosfs) CreateReference(ctx context.Context, p string, targetURI *url.URL) error

func (*Eosfs) CreateStorageSpace

CreateStorageSpace creates a storage space.

func (*Eosfs) Delete

func (fs *Eosfs) Delete(ctx context.Context, ref *provider.Reference) error

func (*Eosfs) DenyGrant

func (fs *Eosfs) DenyGrant(ctx context.Context, ref *provider.Reference, g *provider.Grantee) error

func (*Eosfs) Download

func (fs *Eosfs) Download(ctx context.Context, ref *provider.Reference) (io.ReadCloser, error)

func (*Eosfs) DownloadRevision

func (fs *Eosfs) DownloadRevision(ctx context.Context, ref *provider.Reference, revisionKey string) (io.ReadCloser, error)

func (*Eosfs) EmptyRecycle

func (fs *Eosfs) EmptyRecycle(ctx context.Context) error

func (*Eosfs) EncodeAppName

func (fs *Eosfs) EncodeAppName(a string) string

func (*Eosfs) GetHome

func (fs *Eosfs) GetHome(ctx context.Context) (string, error)

func (*Eosfs) GetLock

func (fs *Eosfs) GetLock(ctx context.Context, ref *provider.Reference) (*provider.Lock, error)

GetLock returns an existing lock on the given reference.

func (*Eosfs) GetMD

func (fs *Eosfs) GetMD(ctx context.Context, ref *provider.Reference, mdKeys []string) (*provider.ResourceInfo, error)

func (*Eosfs) GetPathByID

func (fs *Eosfs) GetPathByID(ctx context.Context, id *provider.ResourceId) (string, error)

func (*Eosfs) GetQuota

func (fs *Eosfs) GetQuota(ctx context.Context, ref *provider.Reference) (totalbytes, usedbytes uint64, err error)

func (*Eosfs) InitiateUpload

func (fs *Eosfs) InitiateUpload(ctx context.Context, ref *provider.Reference, uploadLength int64, metadata map[string]string) (map[string]string, error)

func (*Eosfs) ListFolder

func (fs *Eosfs) ListFolder(ctx context.Context, ref *provider.Reference, mdKeys []string) ([]*provider.ResourceInfo, error)

func (*Eosfs) ListGrants

func (fs *Eosfs) ListGrants(ctx context.Context, ref *provider.Reference) ([]*provider.Grant, error)

func (*Eosfs) ListRecycle

func (fs *Eosfs) ListRecycle(ctx context.Context, basePath, key, relativePath string, from, to *types.Timestamp) ([]*provider.RecycleItem, error)

func (*Eosfs) ListRevisions

func (fs *Eosfs) ListRevisions(ctx context.Context, ref *provider.Reference) ([]*provider.FileVersion, error)

func (*Eosfs) ListStorageSpaces

func (fs *Eosfs) ListStorageSpaces(ctx context.Context, filter []*provider.ListStorageSpacesRequest_Filter) ([]*provider.StorageSpace, error)

func (*Eosfs) ListWithRegex

func (fs *Eosfs) ListWithRegex(ctx context.Context, path, regex string, depth uint, user *userpb.User) ([]*provider.ResourceInfo, error)

func (*Eosfs) Move

func (fs *Eosfs) Move(ctx context.Context, oldRef, newRef *provider.Reference) error

func (*Eosfs) PurgeRecycleItem

func (fs *Eosfs) PurgeRecycleItem(ctx context.Context, basePath, key, relativePath string) error

func (*Eosfs) RefreshLock

func (fs *Eosfs) RefreshLock(ctx context.Context, ref *provider.Reference, newLock *provider.Lock, existingLockID string) error

RefreshLock refreshes an existing lock on the given reference.

func (*Eosfs) RemoveGrant

func (fs *Eosfs) RemoveGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) error

func (*Eosfs) RestoreRecycleItem

func (fs *Eosfs) RestoreRecycleItem(ctx context.Context, basePath, key, relativePath string, restoreRef *provider.Reference) error

func (*Eosfs) RestoreRevision

func (fs *Eosfs) RestoreRevision(ctx context.Context, ref *provider.Reference, revisionKey string) error

func (*Eosfs) SetArbitraryMetadata

func (fs *Eosfs) SetArbitraryMetadata(ctx context.Context, ref *provider.Reference, md *provider.ArbitraryMetadata) error

func (*Eosfs) SetLock

func (fs *Eosfs) SetLock(ctx context.Context, ref *provider.Reference, l *provider.Lock) error

SetLock puts a lock on the given reference.

func (*Eosfs) Shutdown

func (fs *Eosfs) Shutdown(ctx context.Context) error

func (*Eosfs) TouchFile

func (fs *Eosfs) TouchFile(ctx context.Context, ref *provider.Reference) error

TouchFile as defined in the storage.FS interface.

func (*Eosfs) Unlock

func (fs *Eosfs) Unlock(ctx context.Context, ref *provider.Reference, lock *provider.Lock) error

Unlock removes an existing lock from the given reference.

func (*Eosfs) UnsetArbitraryMetadata

func (fs *Eosfs) UnsetArbitraryMetadata(ctx context.Context, ref *provider.Reference, keys []string) error

func (*Eosfs) UpdateGrant

func (fs *Eosfs) UpdateGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) error

func (*Eosfs) UpdateStorageSpace

UpdateStorageSpace updates a storage space.

func (*Eosfs) Upload

func (fs *Eosfs) Upload(ctx context.Context, ref *provider.Reference, r io.ReadCloser, metadata map[string]string) error

Jump to

Keyboard shortcuts

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