Documentation
¶
Index ¶
- type Bucket
- 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) 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) 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 BucketsClient
- type DirEntries
- type GetBucketContextFn
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) 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) GetData ¶
func (b *Bucket) GetData() BucketData
func (*Bucket) GetThreadID ¶ added in v0.0.13
func (*Bucket) ListDirectory ¶
ListDirectory returns a list of items in a particular directory
type BucketData ¶
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) }
type DirEntries ¶
type DirEntries bucketsproto.ListPathResponse
Click to show internal directories.
Click to hide internal directories.