[#19] Rename client-oriented entities before adding fake/mock ones
Signed-off-by: Pavel Korotkov <pavel@nspcc.ru>
This commit is contained in:
parent
aedd468c18
commit
c909c99f72
1 changed files with 11 additions and 11 deletions
|
@ -72,18 +72,18 @@ type ClientPlant interface {
|
||||||
OwnerID() *owner.ID
|
OwnerID() *owner.ID
|
||||||
}
|
}
|
||||||
|
|
||||||
type objectClient struct {
|
type neofsObjectClient struct {
|
||||||
key *ecdsa.PrivateKey
|
key *ecdsa.PrivateKey
|
||||||
conn *grpc.ClientConn
|
conn *grpc.ClientConn
|
||||||
}
|
}
|
||||||
|
|
||||||
type neofsClient struct {
|
type neofsClientPlant struct {
|
||||||
key *ecdsa.PrivateKey
|
key *ecdsa.PrivateKey
|
||||||
ownerID *owner.ID
|
ownerID *owner.ID
|
||||||
conn *grpc.ClientConn
|
conn *grpc.ClientConn
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cc *neofsClient) GetReusableArtifacts(ctx context.Context) (client.Client, *token.SessionToken, error) {
|
func (cc *neofsClientPlant) GetReusableArtifacts(ctx context.Context) (client.Client, *token.SessionToken, error) {
|
||||||
c, err := client.New(client.WithDefaultPrivateKey(cc.key), client.WithGRPCConnection(cc.conn))
|
c, err := client.New(client.WithDefaultPrivateKey(cc.key), client.WithGRPCConnection(cc.conn))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, errors.Wrap(err, "failed to create reusable neofs client")
|
return nil, nil, errors.Wrap(err, "failed to create reusable neofs client")
|
||||||
|
@ -95,11 +95,11 @@ func (cc *neofsClient) GetReusableArtifacts(ctx context.Context) (client.Client,
|
||||||
return c, st, nil
|
return c, st, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cc *neofsClient) Object() ObjectClient {
|
func (cc *neofsClientPlant) Object() ObjectClient {
|
||||||
return &objectClient{key: cc.key, conn: cc.conn}
|
return &neofsObjectClient{key: cc.key, conn: cc.conn}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cc *neofsClient) OwnerID() *owner.ID {
|
func (cc *neofsClientPlant) OwnerID() *owner.ID {
|
||||||
return cc.ownerID
|
return cc.ownerID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,14 +132,14 @@ func NewClientPlant(ctx context.Context, connectionList ConnectionList, creds Cr
|
||||||
}
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &neofsClient{
|
return &neofsClientPlant{
|
||||||
key: creds.PrivateKey(),
|
key: creds.PrivateKey(),
|
||||||
ownerID: creds.Owner(),
|
ownerID: creds.Owner(),
|
||||||
conn: conn,
|
conn: conn,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (oc *objectClient) Put(ctx context.Context, options *PutOptions) (*object.Address, error) {
|
func (oc *neofsObjectClient) Put(ctx context.Context, options *PutOptions) (*object.Address, error) {
|
||||||
var (
|
var (
|
||||||
err error
|
err error
|
||||||
objectID *object.ID
|
objectID *object.ID
|
||||||
|
@ -199,7 +199,7 @@ func (oc *objectClient) Put(ctx context.Context, options *PutOptions) (*object.A
|
||||||
return address, nil
|
return address, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (oc *objectClient) Get(ctx context.Context, options *GetOptions) (*object.Object, error) {
|
func (oc *neofsObjectClient) Get(ctx context.Context, options *GetOptions) (*object.Object, error) {
|
||||||
var (
|
var (
|
||||||
err error
|
err error
|
||||||
obj *object.Object
|
obj *object.Object
|
||||||
|
@ -216,7 +216,7 @@ func (oc *objectClient) Get(ctx context.Context, options *GetOptions) (*object.O
|
||||||
return obj, err
|
return obj, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (oc *objectClient) Search(ctx context.Context, options *SearchOptions) ([]*object.ID, error) {
|
func (oc *neofsObjectClient) Search(ctx context.Context, options *SearchOptions) ([]*object.ID, error) {
|
||||||
sfs := object.NewSearchFilters()
|
sfs := object.NewSearchFilters()
|
||||||
sfs.AddRootFilter()
|
sfs.AddRootFilter()
|
||||||
sfs.AddFilter(options.Attribute.Key, options.Attribute.Value, object.MatchStringEqual)
|
sfs.AddFilter(options.Attribute.Key, options.Attribute.Value, object.MatchStringEqual)
|
||||||
|
@ -231,7 +231,7 @@ func (oc *objectClient) Search(ctx context.Context, options *SearchOptions) ([]*
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (oc *objectClient) Delete(ctx context.Context, options *DeleteOptions) error {
|
func (oc *neofsObjectClient) Delete(ctx context.Context, options *DeleteOptions) error {
|
||||||
ops := new(client.DeleteObjectParams).WithAddress(options.ObjectAddress)
|
ops := new(client.DeleteObjectParams).WithAddress(options.ObjectAddress)
|
||||||
err := options.Client.DeleteObject(
|
err := options.Client.DeleteObject(
|
||||||
ctx,
|
ctx,
|
||||||
|
|
Loading…
Reference in a new issue