Documentation ¶
Index ¶
- type CreateObject
- type DB
- func (db *DB) CreateBucket(ctx context.Context, bucketName string) (bucketInfo storj.Bucket, err error)
- func (db *DB) CreateObject(ctx context.Context, bucket storj.Bucket, path storj.Path, ...) (object MutableObject, err error)
- func (db *DB) DeleteBucket(ctx context.Context, bucketName string) (_ storj.Bucket, err error)
- func (db *DB) DeleteObject(ctx context.Context, bucket storj.Bucket, path storj.Path) (_ storj.Object, err error)
- func (db *DB) GetBucket(ctx context.Context, bucketName string) (bucketInfo storj.Bucket, err error)
- func (db *DB) GetObject(ctx context.Context, bucket storj.Bucket, path storj.Path) (info storj.Object, err error)
- func (db *DB) GetObjectStream(ctx context.Context, bucket storj.Bucket, object storj.Object) (stream ReadOnlyStream, err error)
- func (db *DB) ListBuckets(ctx context.Context, options storj.BucketListOptions) (list storj.BucketList, err error)
- func (db *DB) ListObjects(ctx context.Context, bucket storj.Bucket, options storj.ListOptions) (list storj.ObjectList, err error)
- func (db *DB) ListPendingObjects(ctx context.Context, bucket storj.Bucket, options storj.ListOptions) (list storj.ObjectList, err error)
- func (db *DB) ModifyObject(ctx context.Context, bucket storj.Bucket, path storj.Path) (object MutableObject, err error)
- func (db *DB) ModifyPendingObject(ctx context.Context, bucket storj.Bucket, path storj.Path) (object MutableObject, err error)
- type MutableObject
- type MutableStream
- type Project
- func (db *Project) CreateBucket(ctx context.Context, bucketName string) (newBucket storj.Bucket, err error)
- func (db *Project) DeleteBucket(ctx context.Context, bucketName string) (bucket storj.Bucket, err error)
- func (db *Project) GetBucket(ctx context.Context, bucketName string) (bucket storj.Bucket, err error)
- func (db *Project) ListBuckets(ctx context.Context, listOpts storj.BucketListOptions) (bucketList storj.BucketList, err error)
- type ReadOnlyStream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateObject ¶
type CreateObject struct { Metadata map[string]string ContentType string Expires time.Time storj.RedundancyScheme storj.EncryptionParameters }
CreateObject has optional parameters that can be set.
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB implements metainfo database.
func New ¶
func New(project *Project, metainfo *metainfo.Client, streams streams.Store, segments segments.Store, encStore *encryption.Store) *DB
New creates a new metainfo database.
func (*DB) CreateBucket ¶
func (db *DB) CreateBucket(ctx context.Context, bucketName string) (bucketInfo storj.Bucket, err error)
CreateBucket creates a new bucket with the specified information.
func (*DB) CreateObject ¶
func (db *DB) CreateObject(ctx context.Context, bucket storj.Bucket, path storj.Path, createInfo *CreateObject) (object MutableObject, err error)
CreateObject creates an uploading object and returns an interface for uploading Object information.
func (*DB) DeleteBucket ¶
DeleteBucket deletes bucket.
func (*DB) DeleteObject ¶
func (db *DB) DeleteObject(ctx context.Context, bucket storj.Bucket, path storj.Path) (_ storj.Object, err error)
DeleteObject deletes an object from database.
func (*DB) GetBucket ¶
func (db *DB) GetBucket(ctx context.Context, bucketName string) (bucketInfo storj.Bucket, err error)
GetBucket gets bucket information.
func (*DB) GetObject ¶
func (db *DB) GetObject(ctx context.Context, bucket storj.Bucket, path storj.Path) (info storj.Object, err error)
GetObject returns information about an object.
func (*DB) GetObjectStream ¶
func (db *DB) GetObjectStream(ctx context.Context, bucket storj.Bucket, object storj.Object) (stream ReadOnlyStream, err error)
GetObjectStream returns interface for reading the object stream.
func (*DB) ListBuckets ¶
func (db *DB) ListBuckets(ctx context.Context, options storj.BucketListOptions) (list storj.BucketList, err error)
ListBuckets lists buckets.
func (*DB) ListObjects ¶
func (db *DB) ListObjects(ctx context.Context, bucket storj.Bucket, options storj.ListOptions) (list storj.ObjectList, err error)
ListObjects lists objects in bucket based on the ListOptions.
func (*DB) ListPendingObjects ¶
func (db *DB) ListPendingObjects(ctx context.Context, bucket storj.Bucket, options storj.ListOptions) (list storj.ObjectList, err error)
ListPendingObjects lists pending objects in bucket based on the ListOptions.
type MutableObject ¶
type MutableObject interface { // Info gets the current information about the object. Info() storj.Object // CreateStream creates a new stream for the object. CreateStream(ctx context.Context) (MutableStream, error) // ContinueStream starts to continue a partially uploaded stream. ContinueStream(ctx context.Context) (MutableStream, error) // DeleteStream deletes any information about this objects stream. DeleteStream(ctx context.Context) error // Commit commits the changes to the database. Commit(ctx context.Context) error }
MutableObject is an interface for manipulating creating/deleting object stream.
type MutableStream ¶
type MutableStream interface { BucketName() string Path() string Expires() time.Time Metadata() ([]byte, error) // AddSegments adds segments to the stream. AddSegments(ctx context.Context, segments ...storj.Segment) error // UpdateSegments updates information about segments. UpdateSegments(ctx context.Context, segments ...storj.Segment) error }
MutableStream is an interface for manipulating stream information.
type Project ¶
type Project struct {
// contains filtered or unexported fields
}
Project implements project management operations.
func NewProject ¶
func NewProject(streams streams.Store, encryptedBlockSize int32, segmentsSize int64, metainfo metainfo.Client) *Project
NewProject constructs a *Project.
func (*Project) CreateBucket ¶
func (db *Project) CreateBucket(ctx context.Context, bucketName string) (newBucket storj.Bucket, err error)
CreateBucket creates a new bucket.
func (*Project) DeleteBucket ¶
func (db *Project) DeleteBucket(ctx context.Context, bucketName string) (bucket storj.Bucket, err error)
DeleteBucket deletes bucket.
func (*Project) GetBucket ¶
func (db *Project) GetBucket(ctx context.Context, bucketName string) (bucket storj.Bucket, err error)
GetBucket gets bucket information.
func (*Project) ListBuckets ¶
func (db *Project) ListBuckets(ctx context.Context, listOpts storj.BucketListOptions) (bucketList storj.BucketList, err error)
ListBuckets lists buckets.
type ReadOnlyStream ¶
type ReadOnlyStream interface { Info() storj.Object // SegmentsAt returns the segment that contains the byteOffset and following segments. // Limit specifies how much to return at most. SegmentsAt(ctx context.Context, byteOffset int64, limit int64) (infos []storj.Segment, more bool, err error) // Segments returns the segment at index. // Limit specifies how much to return at most. Segments(ctx context.Context, index int64, limit int64) (infos []storj.Segment, more bool, err error) }
ReadOnlyStream is an interface for reading segment information.