Merge branch 'release/0.6.2'

This commit is contained in:
Evgeniy Kulikov 2020-04-16 11:53:42 +03:00
commit ce8b200458
No known key found for this signature in database
GPG key ID: BF6AEE0A2A699BF2
10 changed files with 180 additions and 45 deletions

View file

@ -1,6 +1,20 @@
# Changelog
This is the changelog for NeoFS-API-Go
## [0.6.2] - 2020-04-16
### Updated
- NeoFS API v0.6.1
- Protobuf v1.4.0
- Netmap v1.7.0
- Prometheus Client v1.5.1
- Testify v1.5.1
- gRPC v1.28.1
### Fixed
- formatting
- test coverage for Object.PutRequest.CID method
## [0.6.1] - 2020-04-10
### Changed
@ -241,3 +255,4 @@ Initial public release
[0.5.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.4.2...v0.5.0
[0.6.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.5.0...v0.6.0
[0.6.1]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.6.0...v0.6.1
[0.6.2]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.6.1...v0.6.2

View file

@ -1,4 +1,4 @@
PROTO_VERSION=v0.6.0
PROTO_VERSION=v0.6.1
PROTO_URL=https://github.com/nspcc-dev/neofs-api/archive/$(PROTO_VERSION).tar.gz
B=\033[0;1m

View file

@ -28,11 +28,45 @@ var _ = math.Inf
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
// Node state
type Request_State int32
const (
// used by default
Request_Unknown Request_State = 0
// used to inform that node online
Request_Online Request_State = 1
// used to inform that node offline
Request_Offline Request_State = 2
)
var Request_State_name = map[int32]string{
0: "Unknown",
1: "Online",
2: "Offline",
}
var Request_State_value = map[string]int32{
"Unknown": 0,
"Online": 1,
"Offline": 2,
}
func (x Request_State) String() string {
return proto.EnumName(Request_State_name, int32(x))
}
func (Request_State) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_21bce759c9d8eb63, []int{0, 0}
}
type Request struct {
// Type is NodeType, can be InnerRingNode (type=1) or StorageNode (type=2)
Type NodeType `protobuf:"varint,1,opt,name=type,proto3,customtype=NodeType" json:"type"`
// Info contains information about node
Info NodeInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info"`
// State contains node status
State Request_State `protobuf:"varint,3,opt,name=state,proto3,enum=bootstrap.Request_State" json:"state,omitempty"`
// RequestMetaHeader contains information about request meta headers (should be embedded into message)
service.RequestMetaHeader `protobuf:"bytes,98,opt,name=Meta,proto3,embedded=Meta" json:"Meta"`
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
@ -78,37 +112,49 @@ func (m *Request) GetInfo() NodeInfo {
return NodeInfo{}
}
func (m *Request) GetState() Request_State {
if m != nil {
return m.State
}
return Request_Unknown
}
func init() {
proto.RegisterEnum("bootstrap.Request_State", Request_State_name, Request_State_value)
proto.RegisterType((*Request)(nil), "bootstrap.Request")
}
func init() { proto.RegisterFile("bootstrap/service.proto", fileDescriptor_21bce759c9d8eb63) }
var fileDescriptor_21bce759c9d8eb63 = []byte{
// 364 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x51, 0xbf, 0x6e, 0x9b, 0x40,
0x18, 0xf7, 0x59, 0xd4, 0x7f, 0xae, 0xdb, 0xd9, 0x55, 0x11, 0x03, 0x58, 0x9e, 0x2c, 0xb5, 0x80,
0x64, 0x2f, 0x1d, 0x5b, 0x54, 0x55, 0xf5, 0x60, 0xcb, 0xc2, 0x55, 0x23, 0x65, 0x3b, 0xe0, 0x83,
0x30, 0x98, 0xbb, 0x70, 0x67, 0x4b, 0x7e, 0x93, 0x3c, 0x43, 0x9e, 0xc4, 0xa3, 0xc7, 0x28, 0x03,
0x8a, 0x88, 0x94, 0xe7, 0x88, 0x38, 0x63, 0x62, 0x25, 0x13, 0x7c, 0xbf, 0x7f, 0xf7, 0xbb, 0xef,
0xf0, 0xd7, 0x80, 0x31, 0x29, 0x64, 0x4e, 0xb9, 0x2b, 0x20, 0xdf, 0xa5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 0xb3, 0x10, 0x84, 0x20, 0xe4, 0xa2, 0x78, 0x9d, 0x67, 0x0c, 0x2f, 0xb0, 0x35,
0xcf, 0x81, 0x46, 0x0b, 0xca, 0xbd, 0xab, 0x43, 0x69, 0xa2, 0x63, 0x69, 0xa2, 0x87, 0xd2, 0x44,
0x4f, 0xa5, 0x89, 0xee, 0x9e, 0xcd, 0xd6, 0xf5, 0xb7, 0x8b, 0x7d, 0x67, 0x82, 0x87, 0xa1, 0x1d,
0xc1, 0xce, 0xcd, 0x80, 0xc5, 0xc2, 0xa6, 0x3c, 0xb5, 0x13, 0xe6, 0x36, 0x61, 0xf7, 0xed, 0xc1,
0x12, 0xd8, 0x9f, 0xb5, 0xf3, 0x6b, 0x35, 0x77, 0x9a, 0x36, 0x41, 0x47, 0x3d, 0xc5, 0xec, 0x35,
0x00, 0x00, 0xff, 0xff, 0xc7, 0x01, 0xac, 0x62, 0x20, 0x02, 0x00, 0x00,
// 420 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x51, 0x4d, 0x8b, 0xd3, 0x40,
0x18, 0xee, 0xd4, 0xb4, 0xdd, 0x9d, 0x05, 0x59, 0x66, 0x57, 0x0c, 0x3d, 0xa4, 0xa5, 0xa7, 0x82,
0x66, 0x02, 0xdd, 0x8b, 0x47, 0x0d, 0x22, 0xee, 0x61, 0x3f, 0x48, 0xfd, 0x00, 0x6f, 0x93, 0xf4,
0x4d, 0x1d, 0x74, 0xe7, 0x1d, 0x33, 0xd3, 0x4a, 0xff, 0x89, 0xbf, 0xc1, 0xff, 0x21, 0xec, 0x71,
0x8f, 0xe2, 0xa1, 0x48, 0xfc, 0x23, 0x32, 0xd3, 0xb4, 0x16, 0xf7, 0x94, 0xbc, 0xcf, 0xd7, 0xbc,
0x1f, 0xf4, 0x71, 0x8e, 0x68, 0x8d, 0xad, 0x84, 0x4e, 0x0c, 0x54, 0x4b, 0x59, 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xfa, 0xdf, 0xeb, 0x59, 0x59, 0x08, 0x2b, 0x51, 0xdd, 0xcb, 0x68, 0xbc,
0xa3, 0x98, 0x76, 0x7c, 0x3f, 0xec, 0x88, 0xf6, 0xde, 0xaa, 0x4f, 0x0a, 0xbf, 0xaa, 0xe3, 0x16,
0xa3, 0xb4, 0x7b, 0xa5, 0x3e, 0x4b, 0x05, 0xc7, 0xc4, 0x11, 0x57, 0x65, 0xe9, 0x8b, 0xf6, 0xe4,
0x39, 0x3d, 0x4c, 0xb7, 0x03, 0xb1, 0x33, 0xda, 0xbb, 0xae, 0xb0, 0x00, 0x63, 0x18, 0xbb, 0x3f,
0x67, 0xff, 0x74, 0x0f, 0x9b, 0xea, 0x0a, 0xc4, 0xec, 0x42, 0xe8, 0xf4, 0xfd, 0x6d, 0x1d, 0x91,
0xbb, 0x3a, 0x22, 0x3f, 0xeb, 0x88, 0xfc, 0xae, 0x23, 0xf2, 0xed, 0x4f, 0xd4, 0xfa, 0xf0, 0x64,
0xef, 0x9c, 0xca, 0xe8, 0xa2, 0x88, 0x67, 0xb0, 0x4c, 0x14, 0x60, 0x69, 0x62, 0xa1, 0x65, 0x3c,
0xc7, 0x64, 0x17, 0xf6, 0xbd, 0x7d, 0x72, 0x09, 0xf8, 0x6a, 0xca, 0x5f, 0x5c, 0x9f, 0xf3, 0x5d,
0x37, 0x79, 0xd7, 0x5f, 0xfa, 0xec, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x74, 0xc6, 0xb6, 0xb6,
0x7f, 0x02, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@ -241,6 +287,11 @@ func (m *Request) MarshalToSizedBuffer(dAtA []byte) (int, error) {
dAtA[i] = 0x6
i--
dAtA[i] = 0x92
if m.State != 0 {
i = encodeVarintService(dAtA, i, uint64(m.State))
i--
dAtA[i] = 0x18
}
{
size, err := m.Info.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
@ -281,6 +332,9 @@ func (m *Request) Size() (n int) {
}
l = m.Info.Size()
n += 1 + l + sovService(uint64(l))
if m.State != 0 {
n += 1 + sovService(uint64(m.State))
}
l = m.RequestMetaHeader.Size()
n += 2 + l + sovService(uint64(l))
l = m.RequestVerificationHeader.Size()
@ -378,6 +432,25 @@ func (m *Request) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field State", wireType)
}
m.State = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowService
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.State |= Request_State(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 98:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field RequestMetaHeader", wireType)

View file

@ -19,10 +19,22 @@ service Bootstrap {
}
message Request {
// Node state
enum State {
// used by default
Unknown = 0;
// used to inform that node online
Online = 1;
// used to inform that node offline
Offline = 2;
}
// Type is NodeType, can be InnerRingNode (type=1) or StorageNode (type=2)
int32 type = 1 [(gogoproto.customname) = "Type" , (gogoproto.nullable) = false, (gogoproto.customtype) = "NodeType"];
// Info contains information about node
bootstrap.NodeInfo info = 2 [(gogoproto.nullable) = false];
// State contains node status
State state = 3;
// RequestMetaHeader contains information about request meta headers (should be embedded into message)
service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)

View file

@ -62,11 +62,25 @@ Process is method that allows to register node in the network and receive actual
| ----- | ---- | ----- | ----------- |
| type | [int32](#int32) | | Type is NodeType, can be InnerRingNode (type=1) or StorageNode (type=2) |
| info | [NodeInfo](#bootstrap.NodeInfo) | | Info contains information about node |
| state | [Request.State](#bootstrap.Request.State) | | State contains node status |
| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) |
| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) |
<!-- end messages -->
<a name="bootstrap.Request.State"></a>
### Request.State
Node state
| Name | Number | Description |
| ---- | ------ | ----------- |
| Unknown | 0 | used by default |
| Online | 1 | used to inform that node online |
| Offline | 2 | used to inform that node offline |
<!-- end enums -->

10
go.mod
View file

@ -4,19 +4,19 @@ go 1.14
require (
github.com/gogo/protobuf v1.3.1
github.com/golang/protobuf v1.3.3
github.com/golang/protobuf v1.4.0
github.com/google/uuid v1.1.1
github.com/mr-tron/base58 v1.1.3
github.com/nspcc-dev/neofs-crypto v0.3.0
github.com/nspcc-dev/netmap v1.6.1
github.com/nspcc-dev/netmap v1.7.0
github.com/nspcc-dev/tzhash v1.4.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.4.1
github.com/prometheus/client_golang v1.5.1
github.com/prometheus/client_model v0.2.0
github.com/spf13/viper v1.6.2
github.com/stretchr/testify v1.4.0
github.com/stretchr/testify v1.5.1
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550
google.golang.org/grpc v1.27.1
google.golang.org/grpc v1.28.1
)
// Used for debug reasons

32
go.sum
View file

@ -23,6 +23,7 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
@ -34,7 +35,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/flynn-archive/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:rZfgFAXFS/z/lEd6LJmf9HVZ1LkgYiHx5pHhV5DR16M=
@ -61,8 +63,15 @@ github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I=
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0 h1:oOuy+ugB+P/kBdUnG5QaMXSIyJ1q38wWSojYCb3z5VQ=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
@ -114,8 +123,8 @@ github.com/nspcc-dev/hrw v1.0.8 h1:vwRuJXZXgkMvf473vFzeWGCfY1WBVeSHAEHvR4u3/Cg=
github.com/nspcc-dev/hrw v1.0.8/go.mod h1:l/W2vx83vMQo6aStyx2AuZrJ+07lGv2JQGlVkPG06MU=
github.com/nspcc-dev/neofs-crypto v0.3.0 h1:zlr3pgoxuzrmGCxc5W8dGVfA9Rro8diFvVnBg0L4ifM=
github.com/nspcc-dev/neofs-crypto v0.3.0/go.mod h1:8w16GEJbH6791ktVqHN9YRNH3s9BEEKYxGhlFnp0cDw=
github.com/nspcc-dev/netmap v1.6.1 h1:Pigqpqi6QSdRiusbq5XlO20A18k6Eyu7j9MzOfAE3CM=
github.com/nspcc-dev/netmap v1.6.1/go.mod h1:mhV3UOg9ljQmu0teQShD6+JYX09XY5gu2I4hIByCH9M=
github.com/nspcc-dev/netmap v1.7.0 h1:ak64xn/gPdgYw4tsqSSF7kAGQGbEpeuJEF3XwBX4L9Y=
github.com/nspcc-dev/netmap v1.7.0/go.mod h1:mhV3UOg9ljQmu0teQShD6+JYX09XY5gu2I4hIByCH9M=
github.com/nspcc-dev/rfc6979 v0.2.0 h1:3e1WNxrN60/6N0DW7+UYisLeZJyfqZTNOjeV/toYvOE=
github.com/nspcc-dev/rfc6979 v0.2.0/go.mod h1:exhIh1PdpDC5vQmyEsGvc4YDM/lyQp/452QxGq/UEso=
github.com/nspcc-dev/tzhash v1.4.0 h1:RVIR+mxOBHl58CE99+DXtE31ylD5PEkZSoWqoj4fVjg=
@ -133,8 +142,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.4.1 h1:FFSuS004yOQEtDdTq+TAOLP5xUq63KqAFYyOi8zA+Y8=
github.com/prometheus/client_golang v1.4.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
github.com/prometheus/client_golang v1.5.1 h1:bdHYieyGlH+6OLEk2YQha8THib30KP0/yD0YH9m6xcA=
github.com/prometheus/client_golang v1.5.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM=
@ -179,6 +188,8 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
@ -247,8 +258,15 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk=
google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.28.1 h1:C1QC6KzgSiLyBabDi87BbjaGreoRgGUF5nOyvfrAZ1k=
google.golang.org/grpc v1.28.1/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0 h1:qdOKuR/EIArgaWNjetjgTzgVTAZ+S/WXVrq9HW9zimw=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
gopkg.in/abiosoft/ishell.v2 v2.0.0/go.mod h1:sFp+cGtH6o4s1FtpVPTMcHq2yue+c4DGOVohJCPUzwY=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=

View file

@ -125,13 +125,14 @@ func (m *GetResponse) NotFull() bool { return checkIsNotFull(m) }
func (m *PutRequest) NotFull() bool { return checkIsNotFull(m) }
// CID returns container id value from object put request.
func (m *PutRequest) CID() CID {
if header := m.GetHeader(); header != nil {
if obj := header.GetObject(); obj != nil {
return obj.SystemHeader.CID
}
func (m *PutRequest) CID() (cid CID) {
if header := m.GetHeader(); header == nil {
return
} else if obj := header.GetObject(); obj == nil {
return
} else {
return obj.SystemHeader.CID
}
return refs.CID{}
}
// CID returns container id value from object get request.

View file

@ -17,6 +17,7 @@ func TestRequest(t *testing.T) {
&GetRangeRequest{},
&GetRangeHashRequest{},
MakePutRequestHeader(nil, nil),
MakePutRequestHeader(&Object{}, nil),
}
types := []RequestType{
@ -28,12 +29,13 @@ func TestRequest(t *testing.T) {
RequestRange,
RequestRangeHash,
RequestPut,
RequestPut,
}
for i := range cases {
v := cases[i]
t.Run(fmt.Sprintf("%T", v), func(t *testing.T) {
t.Run(fmt.Sprintf("%T_%d", v, i), func(t *testing.T) {
require.NotPanics(t, func() { v.CID() })
require.Equal(t, types[i], v.Type())
})

View file

@ -31,7 +31,7 @@ type (
// RequestType of the object service requests.
RequestType int
headerType int
headerType int
)
const (