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 {
|
|
|
|
Send(*object.PutRequest) error
|
|
|
|
CloseAndRecv() (*object.PutResponse, error)
|
|
|
|
}
|
|
|
|
|
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
|
2021-03-15 10:53:08 +00:00
|
|
|
Put(context.Context) (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)
|
|
|
|
}
|