Documentation ¶
Index ¶
- type CS3
- func (cs3 *CS3) Backend() string
- func (cs3 *CS3) CreateSymlink(ctx context.Context, oldname, newname string) error
- func (cs3 *CS3) Delete(ctx context.Context, path string) error
- func (cs3 *CS3) Download(ctx context.Context, req DownloadRequest) (*DownloadResponse, error)
- func (cs3 *CS3) Init(ctx context.Context, spaceid string) (err error)
- func (cs3 *CS3) ListDir(ctx context.Context, path string) ([]*provider.ResourceInfo, error)
- func (cs3 *CS3) MakeDirIfNotExist(ctx context.Context, folder string) error
- func (cs3 *CS3) ReadDir(ctx context.Context, path string) ([]string, error)
- func (cs3 *CS3) ResolveSymlink(ctx context.Context, name string) (string, error)
- func (cs3 *CS3) SimpleDownload(ctx context.Context, downloadpath string) (content []byte, err error)
- func (cs3 *CS3) SimpleUpload(ctx context.Context, uploadpath string, content []byte) error
- func (cs3 *CS3) Stat(ctx context.Context, path string) (*provider.ResourceInfo, error)
- func (cs3 *CS3) Upload(ctx context.Context, req UploadRequest) (*UploadResponse, error)
- type Disk
- func (disk *Disk) Backend() string
- func (disk *Disk) CreateSymlink(_ context.Context, oldname, newname string) error
- func (disk *Disk) Delete(_ context.Context, path string) error
- func (disk *Disk) Download(_ context.Context, req DownloadRequest) (*DownloadResponse, error)
- func (disk *Disk) Init(_ context.Context, _ string) (err error)
- func (disk *Disk) ListDir(ctx context.Context, path string) ([]*provider.ResourceInfo, error)
- func (disk *Disk) MakeDirIfNotExist(_ context.Context, path string) error
- func (disk *Disk) ReadDir(_ context.Context, p string) ([]string, error)
- func (disk *Disk) ResolveSymlink(_ context.Context, path string) (string, error)
- func (disk *Disk) SimpleDownload(ctx context.Context, downloadpath string) ([]byte, error)
- func (disk *Disk) SimpleUpload(ctx context.Context, uploadpath string, content []byte) error
- func (disk *Disk) Stat(ctx context.Context, path string) (*provider.ResourceInfo, error)
- func (disk *Disk) Upload(_ context.Context, req UploadRequest) (*UploadResponse, error)
- type DownloadRequest
- type DownloadResponse
- type Storage
- type UploadRequest
- type UploadResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CS3 ¶
type CS3 struct { SpaceRoot *provider.ResourceId // contains filtered or unexported fields }
CS3 represents a metadata storage with a cs3 storage backend
func NewCS3 ¶ added in v2.19.2
NewCS3 returns a new CS3 instance. Use an authenticated context and be sure to define SpaceRoot manually.
func (*CS3) CreateSymlink ¶
CreateSymlink creates a symlink
func (*CS3) Download ¶ added in v2.16.0
func (cs3 *CS3) Download(ctx context.Context, req DownloadRequest) (*DownloadResponse, error)
Download reads a file from the metadata storage
func (*CS3) ListDir ¶ added in v2.8.0
ListDir returns a list of ResourceInfos for the entries in a given directory
func (*CS3) MakeDirIfNotExist ¶
MakeDirIfNotExist will create a root node in the metadata storage. Requires an authenticated context.
func (*CS3) ResolveSymlink ¶
ResolveSymlink resolves a symlink
func (*CS3) SimpleDownload ¶
func (cs3 *CS3) SimpleDownload(ctx context.Context, downloadpath string) (content []byte, err error)
SimpleDownload reads a file from the metadata storage
func (*CS3) SimpleUpload ¶
SimpleUpload uploads a file to the metadata storage
func (*CS3) Upload ¶ added in v2.8.0
func (cs3 *CS3) Upload(ctx context.Context, req UploadRequest) (*UploadResponse, error)
Upload uploads a file to the metadata storage
type Disk ¶
type Disk struct {
// contains filtered or unexported fields
}
Disk represents a disk metadata storage
func (*Disk) CreateSymlink ¶
CreateSymlink creates a symlink
func (*Disk) Download ¶ added in v2.16.0
func (disk *Disk) Download(_ context.Context, req DownloadRequest) (*DownloadResponse, error)
Download reads a file from disk
func (*Disk) ListDir ¶ added in v2.8.0
ListDir returns a list of ResourceInfos for the entries in a given directory
func (*Disk) MakeDirIfNotExist ¶
MakeDirIfNotExist will create a root node in the metadata storage. Requires an authenticated context.
func (*Disk) ResolveSymlink ¶
ResolveSymlink resolves a symlink
func (*Disk) SimpleDownload ¶
SimpleDownload reads a file from disk
func (*Disk) SimpleUpload ¶
SimpleUpload stores a file on disk
func (*Disk) Upload ¶ added in v2.8.0
func (disk *Disk) Upload(_ context.Context, req UploadRequest) (*UploadResponse, error)
Upload stores a file on disk
type DownloadRequest ¶ added in v2.16.0
DownloadRequest represents a download request and its options
type DownloadResponse ¶ added in v2.16.0
DownloadResponse represents a download response and its options
type Storage ¶
type Storage interface { Backend() string Init(ctx context.Context, name string) (err error) Upload(ctx context.Context, req UploadRequest) (*UploadResponse, error) Download(ctx context.Context, req DownloadRequest) (*DownloadResponse, error) SimpleUpload(ctx context.Context, uploadpath string, content []byte) error SimpleDownload(ctx context.Context, path string) ([]byte, error) Delete(ctx context.Context, path string) error Stat(ctx context.Context, path string) (*provider.ResourceInfo, error) ReadDir(ctx context.Context, path string) ([]string, error) ListDir(ctx context.Context, path string) ([]*provider.ResourceInfo, error) CreateSymlink(ctx context.Context, oldname, newname string) error ResolveSymlink(ctx context.Context, name string) (string, error) MakeDirIfNotExist(ctx context.Context, name string) error }
Storage is the interface to maintain metadata in a storage
func NewCS3Storage ¶
func NewCS3Storage(gwAddr, providerAddr, serviceUserID, serviceUserIDP, machineAuthAPIKey string) (s Storage, err error)
NewCS3Storage returns a new cs3 storage instance. Context passed to methods is irrelevant as the service user will be used. Be sure to call Init before using the storage.
func NewDiskStorage ¶
NewDiskStorage returns a new disk storage instance
type UploadRequest ¶ added in v2.8.0
type UploadRequest struct { Path string Content []byte IfMatchEtag string IfNoneMatch []string IfUnmodifiedSince time.Time MTime time.Time }
UploadRequest represents an upload request and its options
type UploadResponse ¶ added in v2.16.0
UploadResponse represents a upload response