frostfs-api-go-pogpp/storagegroup/storage.go
2020-03-31 10:05:26 +03:00

39 lines
951 B
Go

package storagegroup
import (
"context"
"github.com/nspcc-dev/neofs-api-go/refs"
)
type (
// Store is a interface for storing users storage group
Store interface {
Lister
Receiver
Receptacle
}
// Lister defines list function that returns all storage groups
// created for the passed container
Lister interface {
List(ctx context.Context, cid refs.CID) ([]refs.SGID, error)
}
// Receiver defines get function that returns asked storage group
Receiver interface {
Get(ctx context.Context, cid refs.CID, sgid refs.SGID) (Provider, error)
}
// Receptacle defines put function that places storage group in the
// store.
Receptacle interface {
Put(ctx context.Context, sg Provider) error
}
// InfoReceiver defines GetSGInfo function that returns storage group
// that contains passed object ids.
InfoReceiver interface {
GetSGInfo(ctx context.Context, cid refs.CID, group []refs.ObjectID) (*StorageGroup, error)
}
)