2020-12-02 23:45:25 +00:00
|
|
|
package object
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2023-03-07 13:38:26 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/util"
|
2020-12-02 23:45:25 +00:00
|
|
|
)
|
|
|
|
|
2023-02-05 15:59:38 +00:00
|
|
|
// GetObjectStream is an interface of FrostFS API v2 compatible object streamer.
|
2020-12-02 23:45:25 +00:00
|
|
|
type GetObjectStream interface {
|
|
|
|
util.ServerStream
|
|
|
|
Send(*object.GetResponse) error
|
|
|
|
}
|
|
|
|
|
2023-02-05 15:59:38 +00:00
|
|
|
// GetObjectRangeStream is an interface of FrostFS API v2 compatible payload range streamer.
|
2020-12-07 17:49:47 +00:00
|
|
|
type GetObjectRangeStream interface {
|
|
|
|
util.ServerStream
|
|
|
|
Send(*object.GetRangeResponse) error
|
|
|
|
}
|
|
|
|
|
2023-02-05 15:59:38 +00:00
|
|
|
// SearchStream is an interface of FrostFS API v2 compatible search streamer.
|
2020-12-10 12:26:40 +00:00
|
|
|
type SearchStream interface {
|
|
|
|
util.ServerStream
|
|
|
|
Send(*object.SearchResponse) error
|
|
|
|
}
|
|
|
|
|
2023-02-05 15:59:38 +00:00
|
|
|
// PutObjectStream is an interface of FrostFS API v2 compatible client's object streamer.
|
2021-03-15 10:53:08 +00:00
|
|
|
type PutObjectStream interface {
|
2023-04-03 11:23:53 +00:00
|
|
|
Send(context.Context, *object.PutRequest) error
|
|
|
|
CloseAndRecv(context.Context) (*object.PutResponse, error)
|
2021-03-15 10:53:08 +00:00
|
|
|
}
|
|
|
|
|
2020-12-02 23:45:25 +00:00
|
|
|
// ServiceServer is an interface of utility
|
|
|
|
// serving v2 Object service.
|
|
|
|
type ServiceServer interface {
|
|
|
|
Get(*object.GetRequest, GetObjectStream) error
|
2023-04-03 11:23:53 +00:00
|
|
|
Put() (PutObjectStream, error)
|
2020-12-02 23:45:25 +00:00
|
|
|
Head(context.Context, *object.HeadRequest) (*object.HeadResponse, error)
|
2020-12-10 12:26:40 +00:00
|
|
|
Search(*object.SearchRequest, SearchStream) error
|
2020-12-02 23:45:25 +00:00
|
|
|
Delete(context.Context, *object.DeleteRequest) (*object.DeleteResponse, error)
|
2020-12-07 17:49:47 +00:00
|
|
|
GetRange(*object.GetRangeRequest, GetObjectRangeStream) error
|
2020-12-02 23:45:25 +00:00
|
|
|
GetRangeHash(context.Context, *object.GetRangeHashRequest) (*object.GetRangeHashResponse, error)
|
|
|
|
}
|