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 (
|
2019-07-28 06:55:36 +01:00
|
|
|
"storj.io/storj/uplink/eestream"
|
2019-07-12 13:57:02 +01:00
|
|
|
"storj.io/storj/uplink/metainfo"
|
2019-07-28 10:15:34 +01:00
|
|
|
"storj.io/storj/uplink/storage/buckets"
|
2019-07-28 06:55:36 +01:00
|
|
|
"storj.io/storj/uplink/storage/streams"
|
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-07-12 13:57:02 +01:00
|
|
|
buckets buckets.Store
|
2019-06-21 12:29:31 +01:00
|
|
|
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-07-12 13:57:02 +01:00
|
|
|
func NewProject(streams streams.Store, encryptedBlockSize int32, redundancy eestream.RedundancyStrategy, segmentsSize int64, metainfoClient metainfo.Client) *Project {
|
2019-04-10 23:27:04 +01:00
|
|
|
return &Project{
|
2019-07-12 13:57:02 +01:00
|
|
|
buckets: buckets.NewStore(metainfoClient),
|
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
|
|
|
}
|