Split object service structs from types

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-08-21 15:59:30 +03:00 committed by Stanislav Bogatyrev
parent ae1c1a351c
commit ecb0a4be67
2 changed files with 114 additions and 112 deletions

View file

@ -2,6 +2,8 @@ package object
import (
"context"
"github.com/nspcc-dev/neofs-api-go/v2/session"
)
type Service interface {
@ -13,3 +15,115 @@ type Service interface {
GetRange(context.Context, *GetRangeRequest) (GetRangeObjectStreamer, error)
GetRangeHash(context.Context, *GetRangeHashRequest) (*GetRangeHashResponse, error)
}
type GetRequest struct {
body *GetRequestBody
metaHeader *session.RequestMetaHeader
verifyHeader *session.RequestVerificationHeader
}
type GetResponse struct {
body *GetResponseBody
metaHeader *session.ResponseMetaHeader
verifyHeader *session.ResponseVerificationHeader
}
type PutRequest struct {
body *PutRequestBody
metaHeader *session.RequestMetaHeader
verifyHeader *session.RequestVerificationHeader
}
type PutResponse struct {
body *PutResponseBody
metaHeader *session.ResponseMetaHeader
verifyHeader *session.ResponseVerificationHeader
}
type DeleteRequest struct {
body *DeleteRequestBody
metaHeader *session.RequestMetaHeader
verifyHeader *session.RequestVerificationHeader
}
type DeleteResponse struct {
body *DeleteResponseBody
metaHeader *session.ResponseMetaHeader
verifyHeader *session.ResponseVerificationHeader
}
type HeadRequest struct {
body *HeadRequestBody
metaHeader *session.RequestMetaHeader
verifyHeader *session.RequestVerificationHeader
}
type HeadResponse struct {
body *HeadResponseBody
metaHeader *session.ResponseMetaHeader
verifyHeader *session.ResponseVerificationHeader
}
type SearchRequest struct {
body *SearchRequestBody
metaHeader *session.RequestMetaHeader
verifyHeader *session.RequestVerificationHeader
}
type SearchResponse struct {
body *SearchResponseBody
metaHeader *session.ResponseMetaHeader
verifyHeader *session.ResponseVerificationHeader
}
type GetRangeRequest struct {
body *GetRangeRequestBody
metaHeader *session.RequestMetaHeader
verifyHeader *session.RequestVerificationHeader
}
type GetRangeResponse struct {
body *GetRangeResponseBody
metaHeader *session.ResponseMetaHeader
verifyHeader *session.ResponseVerificationHeader
}
type GetRangeHashRequest struct {
body *GetRangeHashRequestBody
metaHeader *session.RequestMetaHeader
verifyHeader *session.RequestVerificationHeader
}
type GetRangeHashResponse struct {
body *GetRangeHashResponseBody
metaHeader *session.ResponseMetaHeader
verifyHeader *session.ResponseVerificationHeader
}

View file

@ -73,14 +73,6 @@ type GetRequestBody struct {
raw bool
}
type GetRequest struct {
body *GetRequestBody
metaHeader *session.RequestMetaHeader
verifyHeader *session.RequestVerificationHeader
}
type GetObjectPart interface {
getObjectPart()
}
@ -101,14 +93,6 @@ type GetResponseBody struct {
objPart GetObjectPart
}
type GetResponse struct {
body *GetResponseBody
metaHeader *session.ResponseMetaHeader
verifyHeader *session.ResponseVerificationHeader
}
type PutObjectPart interface {
putObjectPart()
}
@ -131,62 +115,22 @@ type PutRequestBody struct {
objPart PutObjectPart
}
type PutRequest struct {
body *PutRequestBody
metaHeader *session.RequestMetaHeader
verifyHeader *session.RequestVerificationHeader
}
type PutResponseBody struct {
id *refs.ObjectID
}
type PutResponse struct {
body *PutResponseBody
metaHeader *session.ResponseMetaHeader
verifyHeader *session.ResponseVerificationHeader
}
type DeleteRequestBody struct {
addr *refs.Address
}
type DeleteRequest struct {
body *DeleteRequestBody
metaHeader *session.RequestMetaHeader
verifyHeader *session.RequestVerificationHeader
}
type DeleteResponseBody struct{}
type DeleteResponse struct {
body *DeleteResponseBody
metaHeader *session.ResponseMetaHeader
verifyHeader *session.ResponseVerificationHeader
}
type HeadRequestBody struct {
addr *refs.Address
mainOnly, raw bool
}
type HeadRequest struct {
body *HeadRequestBody
metaHeader *session.RequestMetaHeader
verifyHeader *session.RequestVerificationHeader
}
type GetHeaderPart interface {
getHeaderPart()
}
@ -203,14 +147,6 @@ type HeadResponseBody struct {
hdrPart GetHeaderPart
}
type HeadResponse struct {
body *HeadResponseBody
metaHeader *session.ResponseMetaHeader
verifyHeader *session.ResponseVerificationHeader
}
type SearchFilter struct {
matchType MatchType
@ -225,26 +161,10 @@ type SearchRequestBody struct {
filters []*SearchFilter
}
type SearchRequest struct {
body *SearchRequestBody
metaHeader *session.RequestMetaHeader
verifyHeader *session.RequestVerificationHeader
}
type SearchResponseBody struct {
idList []*refs.ObjectID
}
type SearchResponse struct {
body *SearchResponseBody
metaHeader *session.ResponseMetaHeader
verifyHeader *session.ResponseVerificationHeader
}
type Range struct {
off, len uint64
}
@ -255,26 +175,10 @@ type GetRangeRequestBody struct {
rng *Range
}
type GetRangeRequest struct {
body *GetRangeRequestBody
metaHeader *session.RequestMetaHeader
verifyHeader *session.RequestVerificationHeader
}
type GetRangeResponseBody struct {
chunk []byte
}
type GetRangeResponse struct {
body *GetRangeResponseBody
metaHeader *session.ResponseMetaHeader
verifyHeader *session.ResponseVerificationHeader
}
type GetRangeHashRequestBody struct {
addr *refs.Address
@ -285,28 +189,12 @@ type GetRangeHashRequestBody struct {
typ refs.ChecksumType
}
type GetRangeHashRequest struct {
body *GetRangeHashRequestBody
metaHeader *session.RequestMetaHeader
verifyHeader *session.RequestVerificationHeader
}
type GetRangeHashResponseBody struct {
typ refs.ChecksumType
hashList [][]byte
}
type GetRangeHashResponse struct {
body *GetRangeHashResponseBody
metaHeader *session.ResponseMetaHeader
verifyHeader *session.ResponseVerificationHeader
}
const (
TypeRegular Type = iota
TypeTombstone