forked from TrueCloudLab/frostfs-node
Add Inner Ring code
This commit is contained in:
parent
dadfd90dcd
commit
b7b5079934
400 changed files with 11420 additions and 8690 deletions
43
pkg/morph/client/container/wrapper/wrapper.go
Normal file
43
pkg/morph/client/container/wrapper/wrapper.go
Normal file
|
@ -0,0 +1,43 @@
|
|||
package wrapper
|
||||
|
||||
import (
|
||||
"github.com/nspcc-dev/neofs-node/pkg/core/container/storage"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client/container"
|
||||
)
|
||||
|
||||
// Client represents the Container contract client.
|
||||
//
|
||||
// It is a type alias of
|
||||
// github.com/nspcc-dev/neofs-node/pkg/morph/client/container.Client.
|
||||
type Client = container.Client
|
||||
|
||||
// CID represents the container identifier.
|
||||
//
|
||||
// CID is a type alias of
|
||||
// github.com/nspcc-dev/neofs-node/pkg/core/container/storage.CID.
|
||||
type CID = storage.CID
|
||||
|
||||
// Wrapper is a wrapper over container contract
|
||||
// client which implements container storage and
|
||||
// eACL storage methods.
|
||||
//
|
||||
// Working wrapper must be created via constructor New.
|
||||
// Using the Wrapper that has been created with new(Wrapper)
|
||||
// expression (or just declaring a Wrapper variable) is unsafe
|
||||
// and can lead to panic.
|
||||
type Wrapper struct {
|
||||
client *Client
|
||||
}
|
||||
|
||||
// New creates, initializes and returns the Wrapper instance.
|
||||
//
|
||||
// If Client is nil, container.ErrNilClient is returned.
|
||||
func New(c *Client) (*Wrapper, error) {
|
||||
if c == nil {
|
||||
return nil, container.ErrNilClient
|
||||
}
|
||||
|
||||
return &Wrapper{
|
||||
client: c,
|
||||
}, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue