Documentation
¶
Index ¶
- type Bucket
- func (b *Bucket) AttachNotifier(n Notifier)
- func (b *Bucket) CreateDirectory(ctx context.Context, path string) (result path.Resolved, root path.Path, err error)
- func (b *Bucket) DeleteDirOrFile(ctx context.Context, path string) (path.Resolved, error)
- func (b *Bucket) DirExists(ctx context.Context, path string) (bool, error)
- func (b *Bucket) FileExists(ctx context.Context, pth string) (bool, error)
- func (b *Bucket) GetClient() BucketsClient
- func (b *Bucket) GetContext(ctx context.Context) (context.Context, *thread.ID, error)
- func (b *Bucket) GetData() BucketData
- func (b *Bucket) GetFile(ctx context.Context, path string, w io.Writer) error
- func (b *Bucket) GetThreadID(ctx context.Context) (*thread.ID, error)
- func (b *Bucket) ItemsCount(ctx context.Context, path string, withRecursive bool) (int32, error)
- func (b *Bucket) Key() string
- func (b *Bucket) ListDirectory(ctx context.Context, path string) (*DirEntries, error)
- func (b *Bucket) Slug() string
- func (b *Bucket) UploadFile(ctx context.Context, path string, reader io.Reader) (result path.Resolved, root path.Path, err error)
- type BucketData
- type BucketInterface
- type BucketsClient
- type DirEntries
- type GetBucketContextFn
- type Notifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
type Bucket struct {
// contains filtered or unexported fields
}
NOTE: all write operations should use the lock for the bucket to keep consistency TODO: Maybe read operations dont need a lock, needs testing struct for implementing bucket interface
func New ¶
func New( root *bucketsproto.Root, getBucketContext GetBucketContextFn, bucketsClient BucketsClient, ) *Bucket
func (*Bucket) AttachNotifier ¶ added in v0.0.22
func (*Bucket) CreateDirectory ¶
func (b *Bucket) CreateDirectory(ctx context.Context, path string) (result path.Resolved, root path.Path, err error)
CreateDirectory creates an empty directory Because textile doesn't support empty directory an empty .keep file is created in the directory
func (*Bucket) DeleteDirOrFile ¶
DeleteDirOrFile will delete file or directory at path
func (*Bucket) FileExists ¶
func (*Bucket) GetClient ¶ added in v0.0.22
func (b *Bucket) GetClient() BucketsClient
func (*Bucket) GetContext ¶ added in v0.0.22
func (*Bucket) GetData ¶
func (b *Bucket) GetData() BucketData
func (*Bucket) GetThreadID ¶ added in v0.0.13
func (*Bucket) ItemsCount ¶ added in v0.0.23
return the recursive items count for a path
func (*Bucket) ListDirectory ¶
ListDirectory returns a list of items in a particular directory
type BucketData ¶
type BucketInterface ¶ added in v0.0.22
type BucketInterface interface { Slug() string Key() string GetData() BucketData GetContext(ctx context.Context) (context.Context, *thread.ID, error) GetClient() BucketsClient GetThreadID(ctx context.Context) (*thread.ID, error) DirExists(ctx context.Context, path string) (bool, error) FileExists(ctx context.Context, path string) (bool, error) UploadFile( ctx context.Context, path string, reader io.Reader, ) (result path.Resolved, root path.Path, err error) GetFile( ctx context.Context, path string, w io.Writer, ) error CreateDirectory( ctx context.Context, path string, ) (result path.Resolved, root path.Path, err error) ListDirectory( ctx context.Context, path string, ) (*DirEntries, error) DeleteDirOrFile( ctx context.Context, path string, ) (path.Resolved, error) ItemsCount( ctx context.Context, path string, withRecursive bool, ) (int32, error) }
type BucketsClient ¶
type BucketsClient interface { PushPath(ctx context.Context, key, pth string, reader io.Reader, opts ...bucketsClient.Option) (result path.Resolved, root path.Resolved, err error) PullPath(ctx context.Context, key, pth string, writer io.Writer, opts ...bucketsClient.Option) error ListPath(ctx context.Context, key, pth string) (*bucketsproto.ListPathResponse, error) RemovePath(ctx context.Context, key, pth string, opts ...bucketsClient.Option) (path.Resolved, error) ListIpfsPath(ctx context.Context, ipfsPath path.Path) (*bucketsproto.ListIpfsPathResponse, error) PushPathAccessRoles(ctx context.Context, key, path string, roles map[string]buckets.Role) error }
type DirEntries ¶
type DirEntries bucketsproto.ListPathResponse
type GetBucketContextFn ¶ added in v0.0.14
Click to show internal directories.
Click to hide internal directories.