2019-04-03 09:46:21 +01:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package kvmetainfo
|
|
|
|
|
2019-04-10 23:27:04 +01:00
|
|
|
import (
|
|
|
|
"storj.io/storj/pkg/eestream"
|
2019-06-21 12:29:31 +01:00
|
|
|
"storj.io/storj/pkg/storage/objects"
|
|
|
|
"storj.io/storj/pkg/storage/streams"
|
|
|
|
"storj.io/storj/pkg/storj"
|
2019-04-10 23:27:04 +01:00
|
|
|
)
|
2019-04-03 09:46:21 +01:00
|
|
|
|
|
|
|
// Project implements project management operations
|
|
|
|
type Project struct {
|
2019-06-21 12:29:31 +01:00
|
|
|
buckets objects.Store
|
|
|
|
streams streams.Store
|
2019-04-10 23:27:04 +01:00
|
|
|
encryptedBlockSize int32
|
|
|
|
redundancy eestream.RedundancyStrategy
|
|
|
|
segmentsSize int64
|
2019-04-03 09:46:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewProject constructs a *Project
|
2019-06-21 12:29:31 +01:00
|
|
|
func NewProject(streams streams.Store, encryptedBlockSize int32, redundancy eestream.RedundancyStrategy, segmentsSize int64) *Project {
|
2019-04-10 23:27:04 +01:00
|
|
|
return &Project{
|
2019-07-03 19:07:44 +01:00
|
|
|
buckets: objects.NewStore(streams, storj.EncNull),
|
2019-06-21 12:29:31 +01:00
|
|
|
streams: streams,
|
2019-04-10 23:27:04 +01:00
|
|
|
encryptedBlockSize: encryptedBlockSize,
|
|
|
|
redundancy: redundancy,
|
|
|
|
segmentsSize: segmentsSize,
|
|
|
|
}
|
2019-04-03 09:46:21 +01:00
|
|
|
}
|