Documentation ¶
Index ¶
- Variables
- type DirEntry
- type FSDataSource
- type ReadSeekCloser
- type SpaceFSDataSource
- func (d *SpaceFSDataSource) CreateEntry(ctx context.Context, path string, mode os.FileMode) (*DirEntry, error)
- func (d *SpaceFSDataSource) Get(ctx context.Context, path string) (*DirEntry, error)
- func (d *SpaceFSDataSource) GetChildren(ctx context.Context, path string) ([]*DirEntry, error)
- func (d *SpaceFSDataSource) Open(ctx context.Context, path string) (ReadSeekCloser, error)
Constants ¶
This section is empty.
Variables ¶
var EntryNotFound = errors.New("Directory entry not found")
EntryNotFound error when a directory is not found
Functions ¶
This section is empty.
Types ¶
type DirEntry ¶
type DirEntry struct {
// contains filtered or unexported fields
}
DirEntry implements the DirEntryOps
func NewDirEntry ¶
func (*DirEntry) Ctime ¶
Ctime implements the DirEntryAttribute Interface It returns the time the directory was created
func (*DirEntry) IsDir ¶
IsDir implement DirEntryAttribute And returns if the directory is a boolean or not
func (*DirEntry) Mode ¶
Mode implements the DirEntryAttribute Interface Currently if it is a file, returns all access permission 0766 but ideally should restrict the permission if owner is not the same as file
type FSDataSource ¶
type FSDataSource interface { // Get a single node Get(ctx context.Context, path string) (*DirEntry, error) // GetChildren returns child entries in the file GetChildren(ctx context.Context, path string) ([]*DirEntry, error) // OpenReader returns a file reader Open(ctx context.Context, path string) (ReadSeekCloser, error) // CreateEntry should create a directory or file based on the mode at the path CreateEntry(ctx context.Context, path string, mode os.FileMode) (*DirEntry, error) }
FSDataSource is data source of file/directories and their information It is used as a local/remote cache for looking up information about the directories. It should also ensure that the user in the context has permission to data that is being request
type ReadSeekCloser ¶
ReadSeekCloser implements interfaces to read, copy, seek and close.
type SpaceFSDataSource ¶
type SpaceFSDataSource struct {
// contains filtered or unexported fields
}
SpaceFSDataSource is an implementation of the FSDataSource It interacts with the Space Service Layer to provide data
func NewSpaceFSDataSource ¶
func NewSpaceFSDataSource(service space.Service) *SpaceFSDataSource
func (*SpaceFSDataSource) CreateEntry ¶
func (d *SpaceFSDataSource) CreateEntry(ctx context.Context, path string, mode os.FileMode) (*DirEntry, error)
CreateEntry creates a directory or file based on the mode at the path
func (*SpaceFSDataSource) GetChildren ¶
GetChildren returns list of entries in a path
func (*SpaceFSDataSource) Open ¶
func (d *SpaceFSDataSource) Open(ctx context.Context, path string) (ReadSeekCloser, error)
Open is invoked to read the content of a file