vpath

package
v0.0.0-...-08f17c8 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: BSD-3-Clause Imports: 11 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateVPathMappings

func ValidateVPathMappings(mappings []VPathMapping) error

ValidateVPathMappings validates the path mappings given

Types

type VPathEntry

type VPathEntry struct {
	Type      VPathEntryType
	Path      string
	IRODSPath string // maybe empty if type is VPathVirtualDir
	ReadOnly  bool

	// Only one of fields below is filled according to the Type
	// both fields may have nil when iRODS entry is not retrieved successfully due to iRODS fail
	VirtualDirEntry *VPathVirtualDirEntry
	IRODSEntry      *irodsclient_fs.Entry
}

VPathEntry is a virtual path entry struct

func NewVPathEntryFromIRODSFSEntry

func NewVPathEntryFromIRODSFSEntry(path string, irodsPath string, irodsEntry *irodsclient_fs.Entry, readonly bool) *VPathEntry

NewVPathEntryFromIRODSFSEntry creates a new VPathEntry from IRODSEntry

func (*VPathEntry) GetIRODSPath

func (entry *VPathEntry) GetIRODSPath(vpath string) (string, error)

GetIRODSPath returns an iRODS path for the given vpath

func (*VPathEntry) IsIRODSEntry

func (entry *VPathEntry) IsIRODSEntry() bool

IsIRODSEntry returns true if the entry is for iRODS entry

func (*VPathEntry) IsVirtualDirEntry

func (entry *VPathEntry) IsVirtualDirEntry() bool

IsVirtualDirEntry returns true if the entry is for virtual dir

func (*VPathEntry) RequireIRODSEntryUpdate

func (entry *VPathEntry) RequireIRODSEntryUpdate() bool

RequireIRODSEntryUpdate returns true if it requires to update IRODSEntry field

func (*VPathEntry) ToString

func (entry *VPathEntry) ToString() string

ToString stringifies the object

func (*VPathEntry) UpdateIRODSEntry

func (entry *VPathEntry) UpdateIRODSEntry(fsClient irods.IRODSFSClient) error

UpdateIRODSEntry updates IRODSEntry field

type VPathEntryType

type VPathEntryType string

VPathEntryType determins if the vpath entry is an actual iRODS entry (irods) or a virtual directory entry (virtual). The virtual directory entries are read-only directories containing irods or other virtual entries in it.

const (
	// VPathVirtualDir is an entry type for virtual directory entry
	VPathVirtualDir VPathEntryType = "virtual"
	// VPathIRODS is an entry type for irods entry
	VPathIRODS VPathEntryType = "irods"
)

type VPathManager

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

VPathManager is a struct that manages virtual paths.

func NewVPathManager

func NewVPathManager(fsClient irods.IRODSFSClient, inodeManager *inode.InodeManager, pathMappings []VPathMapping) (*VPathManager, error)

NewVPathManager creates a new VPathManager

func (*VPathManager) GetClosestEntry

func (manager *VPathManager) GetClosestEntry(vpath string) *VPathEntry

GetClosestEntry returns the closest VFS Entry for the path if an entry for the given vpath exists, returns it if not exists, finds a parent dir entry that exists

func (*VPathManager) GetEntry

func (manager *VPathManager) GetEntry(vpath string) *VPathEntry

GetEntry returns VFS Entry for the Path

func (*VPathManager) HasEntry

func (manager *VPathManager) HasEntry(vpath string) bool

HasEntry returns true if it has VFS Entry for the path

type VPathMapping

type VPathMapping struct {
	IRODSPath           string                   `yaml:"irods_path" json:"irods_path"`
	MappingPath         string                   `yaml:"mapping_path" json:"mapping_path"`
	ResourceType        VPathMappingResourceType `yaml:"resource_type" json:"resource_type"`
	ReadOnly            bool                     `yaml:"read_only" json:"read_only"`
	CreateDir           bool                     `yaml:"create_dir" json:"create_dir"`
	IgnoreNotExistError bool                     `yaml:"ignore_not_exist_error" json:"ignore_not_exist_error"`
}

VPathMapping defines a path mapping between iRODS DataObject/Collection and local file/directory

func (*VPathMapping) Validate

func (mapping *VPathMapping) Validate() error

Validate validates VPathMapping

type VPathMappingResourceType

type VPathMappingResourceType string

VPathMappingResourceType determines the type of Virtual Path Mapping resource entry

const (
	// VPathMappingFile is for file entry
	VPathMappingFile VPathMappingResourceType = "file"
	// VPathMappingDirectory is for directory entry
	VPathMappingDirectory VPathMappingResourceType = "dir"
)

func (VPathMappingResourceType) MarshalJSON

func (t VPathMappingResourceType) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON representation of a VPathMappingResourceType.

func (VPathMappingResourceType) String

func (t VPathMappingResourceType) String() string

String returns the string representation of a VPathMappingResourceType.

func (*VPathMappingResourceType) UnmarshalJSON

func (t *VPathMappingResourceType) UnmarshalJSON(b []byte) error

UnmarshalJSON converts the JSON representation of a VPathMappingResourceType to the appropriate enumeration constant.

type VPathVirtualDirEntry

type VPathVirtualDirEntry struct {
	ID         uint64
	Name       string
	Path       string
	Owner      string
	Size       int64
	CreateTime time.Time
	ModifyTime time.Time
	DirEntries []*VPathEntry
}

VPathVirtualDirEntry is a virtual directory entry struct

Jump to

Keyboard shortcuts

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