[#19] subnet: Drop related types and fields

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-04-18 08:40:42 +03:00
parent bd44a3f47b
commit ff6d8db741
23 changed files with 171 additions and 1484 deletions

View file

@ -4,9 +4,6 @@ package container
const SysAttributePrefix = "__SYSTEM__"
const (
// SysAttributeSubnet is a string ID of container's storage subnet.
SysAttributeSubnet = SysAttributePrefix + "SUBNET"
// SysAttributeName is a string of human-friendly container name registered as the domain in NNS contract.
SysAttributeName = SysAttributePrefix + "NAME"
@ -22,10 +19,6 @@ const (
const SysAttributePrefixNeoFS = "__NEOFS__"
const (
// SysAttributeSubnetNeoFS is a string ID of container's storage subnet.
// Deprecated: use SysAttributeSubnet
SysAttributeSubnetNeoFS = SysAttributePrefixNeoFS + "SUBNET"
// SysAttributeNameNeoFS is a string of human-friendly container name registered as the domain in NNS contract.
// Deprecated: use SysAttributeName
SysAttributeNameNeoFS = SysAttributePrefixNeoFS + "NAME"

View file

@ -131,10 +131,6 @@ func (x *Container) GetPlacementPolicy() *grpc1.PlacementPolicy {
//
// There are some "well-known" attributes affecting system behaviour:
//
// - [ __SYSTEM__SUBNET ] \
// (`__NEOFS__SUBNET` is deprecated) \
// String ID of a container's storage subnet. Any container can be attached to
// one subnet only.
// - [ __SYSTEM__NAME ] \
// (`__NEOFS__NAME` is deprecated) \
// String of a human-friendly container name registered as a domain in

View file

@ -1,232 +0,0 @@
package netmap
import (
"errors"
"fmt"
"strings"
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs"
)
// prefix of keys to subnet attributes.
const attrSubnetPrefix = "__SYSTEM__SUBNET_"
// prefix of keys to subnet attributes.
// Deprecated: use attrSubnetPrefix
const attrSubnetPrefixNeoFS = "__NEOFS__SUBNET_"
const (
// subnet attribute's value denoting subnet entry
attrSubnetValEntry = "True"
// subnet attribute's value denoting subnet exit
attrSubnetValExit = "False"
)
// NodeSubnetInfo groups information about subnet which can be written to NodeInfo.
//
// Zero value represents entry to zero subnet.
type NodeSubnetInfo struct {
exit bool
id *refs.SubnetID
}
// Enabled returns true iff subnet membership is enabled for the node.
func (x NodeSubnetInfo) Enabled() bool {
return !x.exit
}
// SetEntryFlag sets the subnet entry flag.
func (x *NodeSubnetInfo) SetEntryFlag(enters bool) {
x.exit = !enters
}
// ID returns identifier of the subnet.
func (x NodeSubnetInfo) ID() *refs.SubnetID {
return x.id
}
// SetID sets identifier of the subnet.
func (x *NodeSubnetInfo) SetID(id *refs.SubnetID) {
x.id = id
}
func subnetAttributeKey(id *refs.SubnetID) string {
txt, _ := id.MarshalText() // never returns an error
return attrSubnetPrefix + string(txt)
}
// WriteSubnetInfo writes NodeSubnetInfo to NodeInfo via attributes. NodeInfo must not be nil.
//
// Existing subnet attributes are expected to be key-unique, otherwise undefined behavior.
//
// Does not add (removes existing) attribute if node:
// - disables non-zero subnet;
// - enables zero subnet.
//
// Attribute key is calculated from ID using format `__SYSTEM__SUBNET_%s`.
// Attribute Value is:
// - `True` if node enters the subnet;
// - `False`, otherwise.
func WriteSubnetInfo(node *NodeInfo, info NodeSubnetInfo) {
attrs := node.GetAttributes()
id := info.ID()
enters := info.Enabled()
// calculate attribute key
key := subnetAttributeKey(id)
if refs.IsZeroSubnet(id) == enters {
for i := range attrs {
if attrs[i].GetKey() == key {
attrs = append(attrs[:i], attrs[i+1:]...)
break // attributes are expected to be key-unique
}
}
} else {
var val string
if enters {
val = attrSubnetValEntry
} else {
val = attrSubnetValExit
}
presented := false
for i := range attrs {
if attrs[i].GetKey() == key {
attrs[i].SetValue(val)
presented = true
}
}
if !presented {
index := len(attrs)
attrs = append(attrs, Attribute{})
attrs[index].SetKey(key)
attrs[index].SetValue(val)
}
}
node.SetAttributes(attrs)
}
// ErrRemoveSubnet is returned when a node needs to leave the subnet.
var ErrRemoveSubnet = errors.New("remove subnet")
var errNoSubnets = errors.New("no subnets")
// IterateSubnets iterates over all subnets the node belongs to and passes the IDs to f.
// Handler must not be nil.
//
// Subnet attributes are expected to be key-unique, otherwise undefined behavior.
//
// If f returns ErrRemoveSubnet, then removes subnet entry. Note that this leads to an instant mutation of NodeInfo.
// Breaks on any other non-nil error and returns it.
//
// Returns an error if any subnet attribute has wrong format.
// Returns an error if the node is not included in any subnet by the end of the loop.
func IterateSubnets(node *NodeInfo, f func(refs.SubnetID) error) error {
attrs := node.GetAttributes()
var (
err error
id refs.SubnetID
entries uint
zeroEntry = true
)
for i := 0; i < len(attrs); i++ { // range must not be used because of attrs mutation in body
key := attrs[i].GetKey()
// cut subnet ID string
idTxt := strings.TrimPrefix(key, attrSubnetPrefix)
if len(idTxt) == len(key) {
idTxt = strings.TrimPrefix(key, attrSubnetPrefixNeoFS)
if len(idTxt) == len(key) {
// not a subnet attribute
continue
}
}
// check value
val := attrs[i].GetValue()
if val != attrSubnetValExit && val != attrSubnetValEntry {
return fmt.Errorf("invalid attribute value: %s", val)
}
// decode subnet ID
if err = id.UnmarshalText([]byte(idTxt)); err != nil {
return fmt.Errorf("invalid ID text: %w", err)
}
// update status of zero subnet
isZero := refs.IsZeroSubnet(&id)
if isZero {
zeroEntry = val == attrSubnetValEntry
}
// continue to process only the subnets to which the node belongs
if val == attrSubnetValExit {
continue
}
// pass ID to the handler
err = f(id)
isRemoveErr := errors.Is(err, ErrRemoveSubnet)
if err != nil && !isRemoveErr {
return err
}
if isRemoveErr {
if isZero {
// we can't remove attribute of zero subnet because it means entry
attrs[i].SetValue(attrSubnetValExit)
} else {
// we can set False or remove attribute, latter is more memory/network efficient.
attrs = append(attrs[:i], attrs[i+1:]...)
i--
}
continue
}
entries++
}
if zeroEntry {
// missing attribute of zero subnet equivalent to entry
refs.MakeZeroSubnet(&id)
err = f(id)
if err != nil {
if !errors.Is(err, ErrRemoveSubnet) {
return err
}
// zero subnet should be clearly removed with False value
index := len(attrs)
attrs = append(attrs, Attribute{})
attrs[index].SetKey(subnetAttributeKey(&id))
attrs[index].SetValue(attrSubnetValExit)
} else {
entries++
}
}
if entries <= 0 {
return errNoSubnets
}
node.SetAttributes(attrs)
return nil
}

View file

@ -1,361 +0,0 @@
package netmap_test
import (
"strconv"
"testing"
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap"
netmaptest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/test"
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs"
"github.com/stretchr/testify/require"
)
func subnetAttrKey(val string) string {
return "__SYSTEM__SUBNET_" + val
}
func assertSubnetAttrKey(t *testing.T, attr *netmap.Attribute, num uint32) {
require.Equal(t, subnetAttrKey(strconv.FormatUint(uint64(num), 10)), attr.GetKey())
}
func BenchmarkNodeAttributes(b *testing.B) {
const size = 50
id := new(refs.SubnetID)
id.SetValue(12)
attrs := make([]netmap.Attribute, size)
for i := range attrs {
if i == size/2 {
attrs[i] = *netmaptest.GenerateAttribute(false)
} else {
data, err := id.MarshalText()
require.NoError(b, err)
attrs[i].SetKey(subnetAttrKey(string(data)))
attrs[i].SetValue("True")
}
}
var info netmap.NodeSubnetInfo
info.SetID(id)
info.SetEntryFlag(false)
node := new(netmap.NodeInfo)
// When using a single slice `StartTimer` overhead is comparable to the
// function execution time, so we reduce this cost by updating slices in groups.
const cacheSize = 1000
a := make([][]netmap.Attribute, cacheSize)
for i := range a {
a[i] = make([]netmap.Attribute, size)
}
b.ResetTimer()
b.ReportAllocs()
for i := 0; i < b.N; i++ {
if i%cacheSize == 0 {
b.StopTimer()
for j := range a {
copy(a[j], attrs)
}
b.StartTimer()
}
node.SetAttributes(a[i%cacheSize])
netmap.WriteSubnetInfo(node, info)
if len(node.GetAttributes())+1 != len(attrs) {
b.FailNow()
}
}
}
func TestWriteSubnetInfo(t *testing.T) {
t.Run("entry", func(t *testing.T) {
t.Run("zero subnet", func(t *testing.T) {
var (
node netmap.NodeInfo
info netmap.NodeSubnetInfo
)
netmap.WriteSubnetInfo(&node, info)
// entry to zero subnet does not require an attribute
attrs := node.GetAttributes()
require.Empty(t, attrs)
// exit the subnet
info.SetEntryFlag(false)
netmap.WriteSubnetInfo(&node, info)
// exit from zero subnet should be clearly reflected in attributes
attrs = node.GetAttributes()
require.Len(t, attrs, 1)
attr := &attrs[0]
assertSubnetAttrKey(t, attr, 0)
require.Equal(t, "False", attr.GetValue())
// again enter to zero subnet
info.SetEntryFlag(true)
netmap.WriteSubnetInfo(&node, info)
// attribute should be removed
attrs = node.GetAttributes()
require.Empty(t, attrs)
})
t.Run("non-zero subnet", func(t *testing.T) {
var (
node netmap.NodeInfo
info netmap.NodeSubnetInfo
id refs.SubnetID
)
// create non-zero subnet ID
const num = 15
id.SetValue(num)
// enter to the subnet
info.SetID(&id)
info.SetEntryFlag(true)
netmap.WriteSubnetInfo(&node, info)
// check attribute format
attrs := node.GetAttributes()
require.Len(t, attrs, 1)
attr := &attrs[0]
assertSubnetAttrKey(t, attr, num)
require.Equal(t, "True", attr.GetValue())
// again exit the subnet
info.SetEntryFlag(false)
netmap.WriteSubnetInfo(&node, info)
// attribute should be removed
attrs = node.GetAttributes()
require.Empty(t, attrs)
})
})
}
func TestSubnets(t *testing.T) {
t.Run("empty", func(t *testing.T) {
var node netmap.NodeInfo
called := 0
err := netmap.IterateSubnets(&node, func(id refs.SubnetID) error {
called++
require.True(t, refs.IsZeroSubnet(&id))
return nil
})
require.NoError(t, err)
require.EqualValues(t, 1, called)
})
t.Run("with correct attribute", func(t *testing.T) {
var (
node netmap.NodeInfo
attrEntry, attrExit netmap.Attribute
)
const (
numEntry = 13
numExit = 14
)
attrEntry.SetKey(subnetAttrKey(strconv.FormatUint(numEntry, 10)))
attrEntry.SetValue("True")
attrExit.SetKey(subnetAttrKey(strconv.FormatUint(numExit, 10)))
attrExit.SetValue("False")
attrs := []netmap.Attribute{attrEntry, attrEntry}
node.SetAttributes(attrs)
mCalledNums := make(map[uint32]struct{})
err := netmap.IterateSubnets(&node, func(id refs.SubnetID) error {
mCalledNums[id.GetValue()] = struct{}{}
return nil
})
require.NoError(t, err)
require.Len(t, mCalledNums, 2)
_, ok := mCalledNums[numEntry]
require.True(t, ok)
_, ok = mCalledNums[numExit]
require.False(t, ok)
_, ok = mCalledNums[0]
require.True(t, ok)
})
t.Run("with incorrect attribute", func(t *testing.T) {
assertErr := func(attr netmap.Attribute) {
var node netmap.NodeInfo
node.SetAttributes([]netmap.Attribute{attr})
require.Error(t, netmap.IterateSubnets(&node, func(refs.SubnetID) error {
return nil
}))
}
t.Run("incorrect key", func(t *testing.T) {
var attr netmap.Attribute
attr.SetKey(subnetAttrKey("one-two-three"))
assertErr(attr)
})
t.Run("incorrect value", func(t *testing.T) {
var attr netmap.Attribute
attr.SetKey(subnetAttrKey("1"))
for _, invalidVal := range []string{
"",
"Troo",
"Fols",
} {
attr.SetValue(invalidVal)
assertErr(attr)
}
assertErr(attr)
})
})
t.Run("remove entry", func(t *testing.T) {
t.Run("zero", func(t *testing.T) {
var node netmap.NodeInfo
// enter to some non-zero subnet so that zero is not the only one
var attr netmap.Attribute
attr.SetKey(subnetAttrKey("321"))
attr.SetValue("True")
attrs := []netmap.Attribute{attr}
node.SetAttributes(attrs)
err := netmap.IterateSubnets(&node, func(id refs.SubnetID) error {
if refs.IsZeroSubnet(&id) {
return netmap.ErrRemoveSubnet
}
return nil
})
require.NoError(t, err)
attrs = node.GetAttributes()
require.Len(t, attrs, 2)
found := false
for i := range attrs {
if attrs[i].GetKey() == subnetAttrKey("0") {
require.Equal(t, "False", attrs[i].GetValue())
found = true
}
}
require.True(t, found)
})
t.Run("non-zero", func(t *testing.T) {
var (
node netmap.NodeInfo
attr netmap.Attribute
)
attr.SetKey(subnetAttrKey("99"))
attr.SetValue("True")
attrs := []netmap.Attribute{attr}
node.SetAttributes(attrs)
err := netmap.IterateSubnets(&node, func(id refs.SubnetID) error {
if !refs.IsZeroSubnet(&id) {
return netmap.ErrRemoveSubnet
}
return nil
})
require.NoError(t, err)
attrs = node.GetAttributes()
require.Empty(t, attrs)
})
t.Run("all", func(t *testing.T) {
var (
node netmap.NodeInfo
attrs []netmap.Attribute
)
// enter to some non-zero subnet so that zero is not the only one
for i := 1; i <= 5; i++ {
var attr netmap.Attribute
attr.SetKey(subnetAttrKey(strconv.Itoa(i)))
attr.SetValue("True")
attrs = append(attrs, attr)
}
node.SetAttributes(attrs)
err := netmap.IterateSubnets(&node, func(id refs.SubnetID) error {
return netmap.ErrRemoveSubnet
})
require.Error(t, err)
})
})
t.Run("zero subnet removal via attribute", func(t *testing.T) {
var (
node netmap.NodeInfo
attrZero, attrOther netmap.Attribute
)
attrZero.SetKey(subnetAttrKey("0"))
attrZero.SetValue("False")
attrOther.SetKey(subnetAttrKey("1"))
attrOther.SetValue("True")
node.SetAttributes([]netmap.Attribute{attrZero, attrOther})
calledCount := 0
err := netmap.IterateSubnets(&node, func(id refs.SubnetID) error {
require.False(t, refs.IsZeroSubnet(&id))
calledCount++
return nil
})
require.NoError(t, err)
require.EqualValues(t, 1, calledCount)
})
}

View file

@ -198,7 +198,6 @@ func (p *PlacementPolicy) ToGRPCMessage() grpc.Message {
m.SetSelectors(SelectorsToGRPC(p.selectors))
m.SetReplicas(ReplicasToGRPC(p.replicas))
m.SetContainerBackupFactor(p.backupFactor)
m.SetSubnetID(p.subnetID.ToGRPCMessage().(*refsGRPC.SubnetID))
}
return m
@ -227,20 +226,6 @@ func (p *PlacementPolicy) FromGRPCMessage(m grpc.Message) error {
return err
}
subnetID := v.GetSubnetId()
if subnetID == nil {
p.subnetID = nil
} else {
if p.subnetID == nil {
p.subnetID = new(refs.SubnetID)
}
err = p.subnetID.FromGRPCMessage(subnetID)
if err != nil {
return err
}
}
p.backupFactor = v.GetContainerBackupFactor()
return nil

View file

@ -1,7 +1,5 @@
package netmap
import refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
// SetReplicas of placement policy.
func (m *PlacementPolicy) SetReplicas(v []*Replica) {
m.Replicas = v
@ -22,11 +20,6 @@ func (m *PlacementPolicy) SetFilters(v []*Filter) {
m.Filters = v
}
// SetSubnetID sets ID of subnet.
func (m *PlacementPolicy) SetSubnetID(v *refs.SubnetID) {
m.SubnetId = v
}
// SetName of placement filter.
func (m *Filter) SetName(v string) {
m.Name = v

259
netmap/grpc/types.pb.go generated
View file

@ -7,7 +7,6 @@
package netmap
import (
grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
@ -464,9 +463,6 @@ type PlacementPolicy struct {
Selectors []*Selector `protobuf:"bytes,3,rep,name=selectors,proto3" json:"selectors,omitempty"`
// List of named filters to reference in selectors
Filters []*Filter `protobuf:"bytes,4,rep,name=filters,proto3" json:"filters,omitempty"`
// Subnetwork ID to select nodes from. Zero subnet (default) represents
// all of the nodes which didn't explicitly opt out of membership.
SubnetId *grpc.SubnetID `protobuf:"bytes,5,opt,name=subnet_id,json=subnetId,proto3" json:"subnet_id,omitempty"`
}
func (x *PlacementPolicy) Reset() {
@ -529,13 +525,6 @@ func (x *PlacementPolicy) GetFilters() []*Filter {
return nil
}
func (x *PlacementPolicy) GetSubnetId() *grpc.SubnetID {
if x != nil {
return x.SubnetId
}
return nil
}
// NeoFS node description
type NodeInfo struct {
state protoimpl.MessageState
@ -827,14 +816,6 @@ func (x *NetworkInfo) GetNetworkConfig() *NetworkConfig {
// attributes it's a string presenting floating point number with comma or
// point delimiter for decimal part. In the Network Map it will be saved as
// 64-bit unsigned integer representing number of minimal token fractions.
// - [ __SYSTEM__SUBNET_%s ] \
// (`__NEOFS__SUBNET_%s` is deprecated) \
// `True` or `False`. Defines if the node is included in the `%s` subnetwork
// or not. `%s` must be an existing subnetwork's ID (non-negative integer number).
// A node can be included in more than one subnetwork and, therefore, can contain
// more than one subnet attribute. A missing attribute is equivalent to the
// presence of the attribute with `False` value (except default zero subnetwork
// (with `%s` == 0) for which missing attribute means inclusion in that network).
// - UN-LOCODE \
// Node's geographic location in
// [UN/LOCODE](https://www.unece.org/cefact/codesfortrade/codes_index.html)
@ -956,13 +937,6 @@ func (x *NodeInfo_Attribute) GetParents() []string {
// - **ContainerFee** \
// Fee paid for container creation by the container owner.
// Value: little-endian integer. Default: 0.
// - **EigenTrustAlpha** \
// Alpha parameter of EigenTrust algorithm used in the Reputation system.
// Value: decimal floating-point number in UTF-8 string representation.
// Default: 0.
// - **EigenTrustIterations** \
// Number of EigenTrust algorithm iterations to pass in the Reputation system.
// Value: little-endian integer. Default: 0.
// - **EpochDuration** \
// NeoFS epoch duration measured in Sidechain blocks.
// Value: little-endian integer. Default: 0.
@ -1043,116 +1017,111 @@ var File_netmap_grpc_types_proto protoreflect.FileDescriptor
var file_netmap_grpc_types_proto_rawDesc = []byte{
0x0a, 0x17, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79,
0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6e, 0x65, 0x6f, 0x2e, 0x66,
0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x1a, 0x15, 0x72, 0x65, 0x66,
0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x22, 0xa5, 0x01, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x12, 0x0a,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d,
0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
0x6b, 0x65, 0x79, 0x12, 0x2b, 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32,
0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d,
0x61, 0x70, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x02, 0x6f, 0x70,
0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x32, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72,
0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73,
0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65,
0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, 0x9c, 0x01, 0x0a, 0x08, 0x53,
0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63,
0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e,
0x74, 0x12, 0x30, 0x0a, 0x06, 0x63, 0x6c, 0x61, 0x75, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
0x0e, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65,
0x74, 0x6d, 0x61, 0x70, 0x2e, 0x43, 0x6c, 0x61, 0x75, 0x73, 0x65, 0x52, 0x06, 0x63, 0x6c, 0x61,
0x75, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65,
0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28,
0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x3b, 0x0a, 0x07, 0x52, 0x65, 0x70,
0x6c, 0x69, 0x63, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65,
0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65,
0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0xa5, 0x02, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x63, 0x65,
0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65,
0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e,
0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e,
0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61,
0x73, 0x12, 0x36, 0x0a, 0x17, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x62,
0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01,
0x28, 0x0d, 0x52, 0x15, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x42, 0x61, 0x63,
0x6b, 0x75, 0x70, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x38, 0x0a, 0x09, 0x73, 0x65, 0x6c,
0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e,
0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e,
0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x09, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74,
0x6f, 0x72, 0x73, 0x12, 0x32, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x04,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32,
0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07,
0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x12, 0x35, 0x0a, 0x09, 0x73, 0x75, 0x62, 0x6e, 0x65,
0x74, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f,
0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x75, 0x62, 0x6e,
0x65, 0x74, 0x49, 0x44, 0x52, 0x08, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x49, 0x64, 0x22, 0xd8,
0x02, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x70,
0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52,
0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64,
0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61,
0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72,
0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e,
0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e,
0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75,
0x74, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x36,
0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e,
0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x22, 0xa5, 0x01, 0x0a, 0x06,
0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65,
0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2b, 0x0a, 0x02,
0x6f, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66,
0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4f, 0x70, 0x65, 0x72,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x02, 0x6f, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12,
0x32, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74,
0x6d, 0x61, 0x70, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74,
0x65, 0x72, 0x73, 0x22, 0x9c, 0x01, 0x0a, 0x08, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72,
0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20,
0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x30, 0x0a, 0x06, 0x63, 0x6c,
0x61, 0x75, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f,
0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x43, 0x6c,
0x61, 0x75, 0x73, 0x65, 0x52, 0x06, 0x63, 0x6c, 0x61, 0x75, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09,
0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69,
0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74,
0x65, 0x72, 0x22, 0x3b, 0x0a, 0x07, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x12, 0x14, 0x0a,
0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f,
0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22,
0xee, 0x01, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c,
0x69, 0x63, 0x79, 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x18,
0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76,
0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61,
0x52, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x12, 0x36, 0x0a, 0x17, 0x63, 0x6f,
0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x66,
0x61, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x15, 0x63, 0x6f, 0x6e,
0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x46, 0x61, 0x63, 0x74,
0x6f, 0x72, 0x12, 0x38, 0x0a, 0x09, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18,
0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76,
0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f,
0x72, 0x52, 0x09, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x32, 0x0a, 0x07,
0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e,
0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70,
0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52,
0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x4d, 0x0a, 0x09, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
0x75, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70,
0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61,
0x72, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x42, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0f,
0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12,
0x0a, 0x0a, 0x06, 0x4f, 0x4e, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x4f,
0x46, 0x46, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x41, 0x49, 0x4e,
0x54, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x03, 0x22, 0x50, 0x0a, 0x06, 0x4e, 0x65, 0x74,
0x6d, 0x61, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01,
0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x30, 0x0a, 0x05, 0x6e, 0x6f, 0x64,
0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66,
0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x6f, 0x64, 0x65,
0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x0d,
0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x49, 0x0a,
0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x29, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65,
0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73,
0x22, 0xd8, 0x02, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a,
0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09,
0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52,
0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x0a, 0x61, 0x74,
0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24,
0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61,
0x70, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69,
0x62, 0x75, 0x74, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73,
0x12, 0x36, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32,
0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d,
0x61, 0x70, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74,
0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x4d, 0x0a, 0x09, 0x41, 0x74, 0x74, 0x72,
0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a,
0x07, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07,
0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x42, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65,
0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10,
0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x4e, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a,
0x07, 0x4f, 0x46, 0x46, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x41,
0x49, 0x4e, 0x54, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x03, 0x22, 0x50, 0x0a, 0x06, 0x4e,
0x65, 0x74, 0x6d, 0x61, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01,
0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x30, 0x0a, 0x05, 0x6e,
0x6f, 0x64, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x65, 0x6f,
0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x6f,
0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x8f, 0x01,
0x0a, 0x0d, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12,
0x49, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e,
0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x0a,
0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x1a, 0x33, 0x0a, 0x09, 0x50, 0x61,
0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22,
0xbf, 0x01, 0x0a, 0x0b, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12,
0x23, 0x0a, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68,
0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45,
0x70, 0x6f, 0x63, 0x68, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x67, 0x69, 0x63, 0x5f, 0x6e, 0x75,
0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x6d, 0x61, 0x67, 0x69,
0x63, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0c, 0x6d, 0x73, 0x5f, 0x70, 0x65,
0x72, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6d,
0x73, 0x50, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x46, 0x0a, 0x0e, 0x6e, 0x65, 0x74,
0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65,
0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x0a, 0x70, 0x61,
0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x1a, 0x33, 0x0a, 0x09, 0x50, 0x61, 0x72, 0x61,
0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xbf, 0x01,
0x0a, 0x0b, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x0a,
0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01,
0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f,
0x63, 0x68, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x67, 0x69, 0x63, 0x5f, 0x6e, 0x75, 0x6d, 0x62,
0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x6d, 0x61, 0x67, 0x69, 0x63, 0x4e,
0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0c, 0x6d, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f,
0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6d, 0x73, 0x50,
0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x46, 0x0a, 0x0e, 0x6e, 0x65, 0x74, 0x77, 0x6f,
0x72, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d,
0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x52, 0x0d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2a,
0x67, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x15,
0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,
0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x45, 0x51, 0x10, 0x01, 0x12,
0x06, 0x0a, 0x02, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x54, 0x10, 0x03, 0x12,
0x06, 0x0a, 0x02, 0x47, 0x45, 0x10, 0x04, 0x12, 0x06, 0x0a, 0x02, 0x4c, 0x54, 0x10, 0x05, 0x12,
0x06, 0x0a, 0x02, 0x4c, 0x45, 0x10, 0x06, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x52, 0x10, 0x07, 0x12,
0x07, 0x0a, 0x03, 0x41, 0x4e, 0x44, 0x10, 0x08, 0x2a, 0x38, 0x0a, 0x06, 0x43, 0x6c, 0x61, 0x75,
0x73, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4c, 0x41, 0x55, 0x53, 0x45, 0x5f, 0x55, 0x4e, 0x53,
0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x41,
0x4d, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x53, 0x54, 0x49, 0x4e, 0x43, 0x54,
0x10, 0x02, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66,
0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64,
0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d,
0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70,
0x63, 0x3b, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46,
0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4e,
0x65, 0x74, 0x6d, 0x61, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x69, 0x67, 0x52, 0x0d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69,
0x67, 0x2a, 0x67, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19,
0x0a, 0x15, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50,
0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x45, 0x51, 0x10,
0x01, 0x12, 0x06, 0x0a, 0x02, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x54, 0x10,
0x03, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x45, 0x10, 0x04, 0x12, 0x06, 0x0a, 0x02, 0x4c, 0x54, 0x10,
0x05, 0x12, 0x06, 0x0a, 0x02, 0x4c, 0x45, 0x10, 0x06, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x52, 0x10,
0x07, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x44, 0x10, 0x08, 0x2a, 0x38, 0x0a, 0x06, 0x43, 0x6c,
0x61, 0x75, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4c, 0x41, 0x55, 0x53, 0x45, 0x5f, 0x55,
0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04,
0x53, 0x41, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x53, 0x54, 0x49, 0x4e,
0x43, 0x54, 0x10, 0x02, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73,
0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f,
0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70,
0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67,
0x72, 0x70, 0x63, 0x3b, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f,
0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49,
0x2e, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -1183,7 +1152,6 @@ var file_netmap_grpc_types_proto_goTypes = []interface{}{
(*NetworkInfo)(nil), // 10: neo.fs.v2.netmap.NetworkInfo
(*NodeInfo_Attribute)(nil), // 11: neo.fs.v2.netmap.NodeInfo.Attribute
(*NetworkConfig_Parameter)(nil), // 12: neo.fs.v2.netmap.NetworkConfig.Parameter
(*grpc.SubnetID)(nil), // 13: neo.fs.v2.refs.SubnetID
}
var file_netmap_grpc_types_proto_depIdxs = []int32{
0, // 0: neo.fs.v2.netmap.Filter.op:type_name -> neo.fs.v2.netmap.Operation
@ -1192,17 +1160,16 @@ var file_netmap_grpc_types_proto_depIdxs = []int32{
5, // 3: neo.fs.v2.netmap.PlacementPolicy.replicas:type_name -> neo.fs.v2.netmap.Replica
4, // 4: neo.fs.v2.netmap.PlacementPolicy.selectors:type_name -> neo.fs.v2.netmap.Selector
3, // 5: neo.fs.v2.netmap.PlacementPolicy.filters:type_name -> neo.fs.v2.netmap.Filter
13, // 6: neo.fs.v2.netmap.PlacementPolicy.subnet_id:type_name -> neo.fs.v2.refs.SubnetID
11, // 7: neo.fs.v2.netmap.NodeInfo.attributes:type_name -> neo.fs.v2.netmap.NodeInfo.Attribute
2, // 8: neo.fs.v2.netmap.NodeInfo.state:type_name -> neo.fs.v2.netmap.NodeInfo.State
7, // 9: neo.fs.v2.netmap.Netmap.nodes:type_name -> neo.fs.v2.netmap.NodeInfo
12, // 10: neo.fs.v2.netmap.NetworkConfig.parameters:type_name -> neo.fs.v2.netmap.NetworkConfig.Parameter
9, // 11: neo.fs.v2.netmap.NetworkInfo.network_config:type_name -> neo.fs.v2.netmap.NetworkConfig
12, // [12:12] is the sub-list for method output_type
12, // [12:12] is the sub-list for method input_type
12, // [12:12] is the sub-list for extension type_name
12, // [12:12] is the sub-list for extension extendee
0, // [0:12] is the sub-list for field type_name
11, // 6: neo.fs.v2.netmap.NodeInfo.attributes:type_name -> neo.fs.v2.netmap.NodeInfo.Attribute
2, // 7: neo.fs.v2.netmap.NodeInfo.state:type_name -> neo.fs.v2.netmap.NodeInfo.State
7, // 8: neo.fs.v2.netmap.Netmap.nodes:type_name -> neo.fs.v2.netmap.NodeInfo
12, // 9: neo.fs.v2.netmap.NetworkConfig.parameters:type_name -> neo.fs.v2.netmap.NetworkConfig.Parameter
9, // 10: neo.fs.v2.netmap.NetworkInfo.network_config:type_name -> neo.fs.v2.netmap.NetworkConfig
11, // [11:11] is the sub-list for method output_type
11, // [11:11] is the sub-list for method input_type
11, // [11:11] is the sub-list for extension type_name
11, // [11:11] is the sub-list for extension extendee
0, // [0:11] is the sub-list for field type_name
}
func init() { file_netmap_grpc_types_proto_init() }

View file

@ -26,7 +26,6 @@ const (
backupPolicyField = 2
selectorsPolicyField = 3
filtersPolicyField = 4
subnetIDPolicyField = 5
keyAttributeField = 1
valueAttributeField = 2
@ -167,8 +166,6 @@ func (p *PlacementPolicy) StableMarshal(buf []byte) []byte {
offset += protoutil.NestedStructureMarshal(filtersPolicyField, buf[offset:], &p.filters[i])
}
protoutil.NestedStructureMarshal(subnetIDPolicyField, buf[offset:], p.subnetID)
return buf
}
@ -187,8 +184,6 @@ func (p *PlacementPolicy) StableSize() (size int) {
size += protoutil.NestedStructureSize(filtersPolicyField, &p.filters[i])
}
size += protoutil.NestedStructureSize(subnetIDPolicyField, p.subnetID)
return size
}

View file

@ -102,7 +102,6 @@ func GeneratePlacementPolicy(empty bool) *netmap.PlacementPolicy {
m.SetFilters(GenerateFilters(false))
m.SetSelectors(GenerateSelectors(false))
m.SetReplicas(GenerateReplicas(false))
m.SetSubnetID(refstest.GenerateSubnetID(false))
}
return m

View file

@ -59,7 +59,6 @@ type PlacementPolicy struct {
backupFactor uint32
selectors []Selector
filters []Filter
subnetID *refs.SubnetID
}
// Attribute of storage node.
@ -302,14 +301,6 @@ func (p *PlacementPolicy) SetReplicas(replicas []Replica) {
p.replicas = replicas
}
func (p *PlacementPolicy) GetSubnetID() *refs.SubnetID {
return p.subnetID
}
func (p *PlacementPolicy) SetSubnetID(id *refs.SubnetID) {
p.subnetID = id
}
func (a *Attribute) GetKey() string {
if a != nil {
return a.key

View file

@ -266,31 +266,3 @@ func (s *Signature) FromGRPCMessage(m grpc.Message) error {
return nil
}
// ToGRPCMessage forms refs.SubnetID message and returns it as grpc.Message.
func (s *SubnetID) ToGRPCMessage() grpc.Message {
var m *refs.SubnetID
if s != nil {
m = new(refs.SubnetID)
m.SetValue(s.value)
}
return m
}
// FromGRPCMessage restores Info from grpc.Message.
//
// Supported types:
// - refs.SubnetID.
func (s *SubnetID) FromGRPCMessage(m grpc.Message) error {
v, ok := m.(*refs.SubnetID)
if !ok {
return message.NewUnexpectedMessageType(m, v)
}
s.value = v.GetValue()
return nil
}

View file

@ -95,8 +95,3 @@ func (x *ChecksumType) FromString(s string) bool {
return ok
}
// SetValue sets subnet identifier in a base-10 integer format.
func (x *SubnetID) SetValue(v uint32) {
x.Value = v
}

184
refs/grpc/types.pb.go generated
View file

@ -378,59 +378,6 @@ func (x *OwnerID) GetValue() []byte {
return nil
}
// NeoFS subnetwork identifier.
//
// String representation of a value is base-10 integer.
//
// JSON representation is an object containing a single `value` number field.
type SubnetID struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// 4-byte integer subnetwork identifier.
Value uint32 `protobuf:"fixed32,1,opt,name=value,proto3" json:"value,omitempty"`
}
func (x *SubnetID) Reset() {
*x = SubnetID{}
if protoimpl.UnsafeEnabled {
mi := &file_refs_grpc_types_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SubnetID) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SubnetID) ProtoMessage() {}
func (x *SubnetID) ProtoReflect() protoreflect.Message {
mi := &file_refs_grpc_types_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SubnetID.ProtoReflect.Descriptor instead.
func (*SubnetID) Descriptor() ([]byte, []int) {
return file_refs_grpc_types_proto_rawDescGZIP(), []int{4}
}
func (x *SubnetID) GetValue() uint32 {
if x != nil {
return x.Value
}
return 0
}
// API version used by a node.
//
// String presentation is a Semantic Versioning 2.0.0 compatible version string
@ -449,7 +396,7 @@ type Version struct {
func (x *Version) Reset() {
*x = Version{}
if protoimpl.UnsafeEnabled {
mi := &file_refs_grpc_types_proto_msgTypes[5]
mi := &file_refs_grpc_types_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -462,7 +409,7 @@ func (x *Version) String() string {
func (*Version) ProtoMessage() {}
func (x *Version) ProtoReflect() protoreflect.Message {
mi := &file_refs_grpc_types_proto_msgTypes[5]
mi := &file_refs_grpc_types_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -475,7 +422,7 @@ func (x *Version) ProtoReflect() protoreflect.Message {
// Deprecated: Use Version.ProtoReflect.Descriptor instead.
func (*Version) Descriptor() ([]byte, []int) {
return file_refs_grpc_types_proto_rawDescGZIP(), []int{5}
return file_refs_grpc_types_proto_rawDescGZIP(), []int{4}
}
func (x *Version) GetMajor() uint32 {
@ -509,7 +456,7 @@ type Signature struct {
func (x *Signature) Reset() {
*x = Signature{}
if protoimpl.UnsafeEnabled {
mi := &file_refs_grpc_types_proto_msgTypes[6]
mi := &file_refs_grpc_types_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -522,7 +469,7 @@ func (x *Signature) String() string {
func (*Signature) ProtoMessage() {}
func (x *Signature) ProtoReflect() protoreflect.Message {
mi := &file_refs_grpc_types_proto_msgTypes[6]
mi := &file_refs_grpc_types_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -535,7 +482,7 @@ func (x *Signature) ProtoReflect() protoreflect.Message {
// Deprecated: Use Signature.ProtoReflect.Descriptor instead.
func (*Signature) Descriptor() ([]byte, []int) {
return file_refs_grpc_types_proto_rawDescGZIP(), []int{6}
return file_refs_grpc_types_proto_rawDescGZIP(), []int{5}
}
func (x *Signature) GetKey() []byte {
@ -574,7 +521,7 @@ type SignatureRFC6979 struct {
func (x *SignatureRFC6979) Reset() {
*x = SignatureRFC6979{}
if protoimpl.UnsafeEnabled {
mi := &file_refs_grpc_types_proto_msgTypes[7]
mi := &file_refs_grpc_types_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -587,7 +534,7 @@ func (x *SignatureRFC6979) String() string {
func (*SignatureRFC6979) ProtoMessage() {}
func (x *SignatureRFC6979) ProtoReflect() protoreflect.Message {
mi := &file_refs_grpc_types_proto_msgTypes[7]
mi := &file_refs_grpc_types_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -600,7 +547,7 @@ func (x *SignatureRFC6979) ProtoReflect() protoreflect.Message {
// Deprecated: Use SignatureRFC6979.ProtoReflect.Descriptor instead.
func (*SignatureRFC6979) Descriptor() ([]byte, []int) {
return file_refs_grpc_types_proto_rawDescGZIP(), []int{7}
return file_refs_grpc_types_proto_rawDescGZIP(), []int{6}
}
func (x *SignatureRFC6979) GetKey() []byte {
@ -638,7 +585,7 @@ type Checksum struct {
func (x *Checksum) Reset() {
*x = Checksum{}
if protoimpl.UnsafeEnabled {
mi := &file_refs_grpc_types_proto_msgTypes[8]
mi := &file_refs_grpc_types_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -651,7 +598,7 @@ func (x *Checksum) String() string {
func (*Checksum) ProtoMessage() {}
func (x *Checksum) ProtoReflect() protoreflect.Message {
mi := &file_refs_grpc_types_proto_msgTypes[8]
mi := &file_refs_grpc_types_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -664,7 +611,7 @@ func (x *Checksum) ProtoReflect() protoreflect.Message {
// Deprecated: Use Checksum.ProtoReflect.Descriptor instead.
func (*Checksum) Descriptor() ([]byte, []int) {
return file_refs_grpc_types_proto_rawDescGZIP(), []int{8}
return file_refs_grpc_types_proto_rawDescGZIP(), []int{7}
}
func (x *Checksum) GetType() ChecksumType {
@ -701,45 +648,43 @@ var file_refs_grpc_types_proto_rawDesc = []byte{
0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75,
0x65, 0x22, 0x1f, 0x0a, 0x07, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05,
0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c,
0x75, 0x65, 0x22, 0x20, 0x0a, 0x08, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x49, 0x44, 0x12, 0x14,
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x07, 0x52, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x22, 0x35, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12,
0x14, 0x0a, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05,
0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x18, 0x02,
0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x22, 0x6f, 0x0a, 0x09, 0x53,
0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x17, 0x0a, 0x04, 0x73, 0x69,
0x67, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74,
0x75, 0x72, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x03, 0x20,
0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e,
0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x63,
0x68, 0x65, 0x6d, 0x65, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x22, 0x3d, 0x0a, 0x10,
0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x46, 0x43, 0x36, 0x39, 0x37, 0x39,
0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b,
0x65, 0x79, 0x12, 0x17, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c,
0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x4e, 0x0a, 0x08, 0x43,
0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x12, 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76,
0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x54,
0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x73, 0x75, 0x6d, 0x2a, 0x66, 0x0a, 0x0f, 0x53,
0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x10,
0x0a, 0x0c, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31, 0x32, 0x10, 0x00,
0x12, 0x18, 0x0a, 0x14, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x52, 0x46, 0x43, 0x36, 0x39, 0x37,
0x39, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x01, 0x12, 0x27, 0x0a, 0x23, 0x45, 0x43,
0x44, 0x53, 0x41, 0x5f, 0x52, 0x46, 0x43, 0x36, 0x39, 0x37, 0x39, 0x5f, 0x53, 0x48, 0x41, 0x32,
0x35, 0x36, 0x5f, 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x5f, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43,
0x54, 0x10, 0x02, 0x2a, 0x41, 0x0a, 0x0c, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x54,
0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x53, 0x55, 0x4d, 0x5f,
0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44,
0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x54, 0x5a, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x48,
0x41, 0x32, 0x35, 0x36, 0x10, 0x02, 0x42, 0x5b, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72,
0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43,
0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d,
0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67,
0x72, 0x70, 0x63, 0x3b, 0x72, 0x65, 0x66, 0x73, 0xaa, 0x02, 0x18, 0x4e, 0x65, 0x6f, 0x2e, 0x46,
0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x52,
0x65, 0x66, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x75, 0x65, 0x22, 0x35, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a,
0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6d, 0x61,
0x6a, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01,
0x28, 0x0d, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x22, 0x6f, 0x0a, 0x09, 0x53, 0x69, 0x67,
0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x17, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72,
0x65, 0x12, 0x37, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
0x0e, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65,
0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x63, 0x68, 0x65,
0x6d, 0x65, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x22, 0x3d, 0x0a, 0x10, 0x53, 0x69,
0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x46, 0x43, 0x36, 0x39, 0x37, 0x39, 0x12, 0x10,
0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79,
0x12, 0x17, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09,
0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x4e, 0x0a, 0x08, 0x43, 0x68, 0x65,
0x63, 0x6b, 0x73, 0x75, 0x6d, 0x12, 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e,
0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x54, 0x79, 0x70,
0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x18, 0x02,
0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x73, 0x75, 0x6d, 0x2a, 0x66, 0x0a, 0x0f, 0x53, 0x69, 0x67,
0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x0c,
0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31, 0x32, 0x10, 0x00, 0x12, 0x18,
0x0a, 0x14, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x52, 0x46, 0x43, 0x36, 0x39, 0x37, 0x39, 0x5f,
0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x01, 0x12, 0x27, 0x0a, 0x23, 0x45, 0x43, 0x44, 0x53,
0x41, 0x5f, 0x52, 0x46, 0x43, 0x36, 0x39, 0x37, 0x39, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36,
0x5f, 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x5f, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x10,
0x02, 0x2a, 0x41, 0x0a, 0x0c, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x54, 0x79, 0x70,
0x65, 0x12, 0x1d, 0x0a, 0x19, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x53, 0x55, 0x4d, 0x5f, 0x54, 0x59,
0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00,
0x12, 0x06, 0x0a, 0x02, 0x54, 0x5a, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x48, 0x41, 0x32,
0x35, 0x36, 0x10, 0x02, 0x42, 0x5b, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73,
0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f,
0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70,
0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70,
0x63, 0x3b, 0x72, 0x65, 0x66, 0x73, 0xaa, 0x02, 0x18, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c,
0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x52, 0x65, 0x66,
0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -755,7 +700,7 @@ func file_refs_grpc_types_proto_rawDescGZIP() []byte {
}
var file_refs_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_refs_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
var file_refs_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_refs_grpc_types_proto_goTypes = []interface{}{
(SignatureScheme)(0), // 0: neo.fs.v2.refs.SignatureScheme
(ChecksumType)(0), // 1: neo.fs.v2.refs.ChecksumType
@ -763,11 +708,10 @@ var file_refs_grpc_types_proto_goTypes = []interface{}{
(*ObjectID)(nil), // 3: neo.fs.v2.refs.ObjectID
(*ContainerID)(nil), // 4: neo.fs.v2.refs.ContainerID
(*OwnerID)(nil), // 5: neo.fs.v2.refs.OwnerID
(*SubnetID)(nil), // 6: neo.fs.v2.refs.SubnetID
(*Version)(nil), // 7: neo.fs.v2.refs.Version
(*Signature)(nil), // 8: neo.fs.v2.refs.Signature
(*SignatureRFC6979)(nil), // 9: neo.fs.v2.refs.SignatureRFC6979
(*Checksum)(nil), // 10: neo.fs.v2.refs.Checksum
(*Version)(nil), // 6: neo.fs.v2.refs.Version
(*Signature)(nil), // 7: neo.fs.v2.refs.Signature
(*SignatureRFC6979)(nil), // 8: neo.fs.v2.refs.SignatureRFC6979
(*Checksum)(nil), // 9: neo.fs.v2.refs.Checksum
}
var file_refs_grpc_types_proto_depIdxs = []int32{
4, // 0: neo.fs.v2.refs.Address.container_id:type_name -> neo.fs.v2.refs.ContainerID
@ -836,18 +780,6 @@ func file_refs_grpc_types_proto_init() {
}
}
file_refs_grpc_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SubnetID); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_refs_grpc_types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Version); i {
case 0:
return &v.state
@ -859,7 +791,7 @@ func file_refs_grpc_types_proto_init() {
return nil
}
}
file_refs_grpc_types_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_refs_grpc_types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Signature); i {
case 0:
return &v.state
@ -871,7 +803,7 @@ func file_refs_grpc_types_proto_init() {
return nil
}
}
file_refs_grpc_types_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_refs_grpc_types_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SignatureRFC6979); i {
case 0:
return &v.state
@ -883,7 +815,7 @@ func file_refs_grpc_types_proto_init() {
return nil
}
}
file_refs_grpc_types_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
file_refs_grpc_types_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Checksum); i {
case 0:
return &v.state
@ -902,7 +834,7 @@ func file_refs_grpc_types_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_refs_grpc_types_proto_rawDesc,
NumEnums: 2,
NumMessages: 9,
NumMessages: 8,
NumExtensions: 0,
NumServices: 0,
},

View file

@ -261,43 +261,3 @@ func (v *Version) StableSize() (size int) {
func (v *Version) Unmarshal(data []byte) error {
return message.Unmarshal(v, data, new(refs.Version))
}
// SubnetID message field numbers
const (
_ = iota
subnetIDValFNum
)
// StableMarshal marshals SubnetID to NeoFS API V2 binary format (Protocol Buffers with direct field order).
//
// Returns a slice of recorded data. Data is written to the provided buffer if there is enough space.
func (s *SubnetID) StableMarshal(buf []byte) []byte {
if s == nil {
return []byte{}
}
if buf == nil {
buf = make([]byte, s.StableSize())
}
proto.Fixed32Marshal(subnetIDValFNum, buf, s.value)
return buf
}
// StableSize returns the number of bytes required to write SubnetID in NeoFS API V2 binary format (see StableMarshal).
func (s *SubnetID) StableSize() (size int) {
if s != nil {
size += proto.Fixed32Size(subnetIDValFNum, s.value)
}
return
}
// Unmarshal unmarshals SubnetID from NeoFS API V2 binary format (see StableMarshal).
// Must not be called on nil.
//
// Note: empty data corresponds to zero ID value or nil pointer to it.
func (s *SubnetID) Unmarshal(data []byte) error {
return message.Unmarshal(s, data, new(refs.SubnetID))
}

View file

@ -17,6 +17,5 @@ func TestMessageConvert(t *testing.T) {
func(empty bool) message.Message { return refstest.GenerateChecksum(empty) },
func(empty bool) message.Message { return refstest.GenerateSignature(empty) },
func(empty bool) message.Message { return refstest.GenerateVersion(empty) },
func(empty bool) message.Message { return refstest.GenerateSubnetID(empty) },
)
}

View file

@ -106,13 +106,3 @@ func GenerateChecksum(empty bool) *refs.Checksum {
return m
}
func GenerateSubnetID(empty bool) *refs.SubnetID {
m := new(refs.SubnetID)
if !empty {
m.SetValue(666)
}
return m
}

View file

@ -1,10 +1,5 @@
package refs
import (
"fmt"
"strconv"
)
type OwnerID struct {
val []byte
}
@ -45,10 +40,6 @@ type Signature struct {
scheme SignatureScheme
}
type SubnetID struct {
value uint32
}
type Version struct {
major, minor uint32
}
@ -178,56 +169,6 @@ func (s *Signature) SetScheme(scheme SignatureScheme) {
s.scheme = scheme
}
func (s *SubnetID) SetValue(id uint32) {
s.value = id
}
func (s *SubnetID) GetValue() uint32 {
if s != nil {
return s.value
}
return 0
}
// MarshalText encodes SubnetID into text format according to NeoFS API V2 protocol:
// value in base-10 integer string format.
//
// Implements encoding.TextMarshaler.
func (s *SubnetID) MarshalText() ([]byte, error) {
num := s.GetValue() // NPE safe, returns zero on nil (zero subnet)
return []byte(strconv.FormatUint(uint64(num), 10)), nil
}
// UnmarshalText decodes SubnetID from the text according to NeoFS API V2 protocol:
// should be base-10 integer string format with bitsize = 32.
//
// Returns strconv.ErrRange if integer overflows uint32.
//
// Must not be called on nil.
//
// Implements encoding.TextUnmarshaler.
func (s *SubnetID) UnmarshalText(txt []byte) error {
num, err := strconv.ParseUint(string(txt), 10, 32)
if err != nil {
return fmt.Errorf("invalid numeric value: %w", err)
}
s.value = uint32(num)
return nil
}
// IsZeroSubnet returns true iff the SubnetID refers to zero subnet.
func IsZeroSubnet(id *SubnetID) bool {
return id.GetValue() == 0
}
// MakeZeroSubnet makes the SubnetID to refer to zero subnet.
func MakeZeroSubnet(id *SubnetID) {
id.SetValue(0)
}
func (v *Version) GetMajor() uint32 {
if v != nil {
return v.major

View file

@ -1,72 +0,0 @@
package refs_test
import (
"math"
"strconv"
"testing"
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs"
"github.com/stretchr/testify/require"
)
func TestZeroSubnet(t *testing.T) {
id := new(refs.SubnetID)
require.True(t, refs.IsZeroSubnet(id))
id.SetValue(1)
require.False(t, refs.IsZeroSubnet(id))
refs.MakeZeroSubnet(id)
require.True(t, refs.IsZeroSubnet(id))
}
func TestSubnetID_MarshalText(t *testing.T) {
var id refs.SubnetID
const val = 15
id.SetValue(val)
txt, err := id.MarshalText()
require.NoError(t, err)
res, err := strconv.ParseUint(string(txt), 10, 32)
require.NoError(t, err)
require.EqualValues(t, val, res)
t.Run("nil", func(t *testing.T) {
var id *refs.SubnetID
txt, err := id.MarshalText()
require.NoError(t, err)
res, err := strconv.ParseUint(string(txt), 10, 32)
require.NoError(t, err)
require.Zero(t, res)
})
}
func TestSubnetID_UnmarshalText(t *testing.T) {
const val = 15
str := strconv.FormatUint(val, 10)
var id refs.SubnetID
err := id.UnmarshalText([]byte(str))
require.NoError(t, err)
require.EqualValues(t, val, id.GetValue())
t.Run("uint32 overflow", func(t *testing.T) {
txt := strconv.FormatUint(math.MaxUint32+1, 10)
var id refs.SubnetID
err := id.UnmarshalText([]byte(txt))
require.ErrorIs(t, err, strconv.ErrRange)
})
}

View file

@ -1,15 +0,0 @@
package subnet_test
import (
"testing"
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message"
messagetest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message/test"
subnettest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/subnet/test"
)
func TestMessageConvert(t *testing.T) {
messagetest.TestRPCMessage(t,
func(empty bool) message.Message { return subnettest.GenerateSubnetInfo(empty) },
)
}

View file

@ -1,15 +0,0 @@
package subnet
import (
refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
)
// SetID returns identifier of the subnet. Nil arg is equivalent to zero subnet ID.
func (x *SubnetInfo) SetID(id *refs.SubnetID) {
x.Id = id
}
// SetOwner sets subnet owner's ID in NeoFS system.
func (x *SubnetInfo) SetOwner(id *refs.OwnerID) {
x.Owner = id
}

171
subnet/grpc/types.pb.go generated
View file

@ -1,171 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.21.9
// source: subnet/grpc/types.proto
package subnet
import (
grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// NeoFS subnetwork description
type SubnetInfo struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Unique subnet identifier. Missing ID is
// equivalent to zero (default subnetwork) ID.
Id *grpc.SubnetID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// Identifier of the subnetwork owner
Owner *grpc.OwnerID `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"`
}
func (x *SubnetInfo) Reset() {
*x = SubnetInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_subnet_grpc_types_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SubnetInfo) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SubnetInfo) ProtoMessage() {}
func (x *SubnetInfo) ProtoReflect() protoreflect.Message {
mi := &file_subnet_grpc_types_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SubnetInfo.ProtoReflect.Descriptor instead.
func (*SubnetInfo) Descriptor() ([]byte, []int) {
return file_subnet_grpc_types_proto_rawDescGZIP(), []int{0}
}
func (x *SubnetInfo) GetId() *grpc.SubnetID {
if x != nil {
return x.Id
}
return nil
}
func (x *SubnetInfo) GetOwner() *grpc.OwnerID {
if x != nil {
return x.Owner
}
return nil
}
var File_subnet_grpc_types_proto protoreflect.FileDescriptor
var file_subnet_grpc_types_proto_rawDesc = []byte{
0x0a, 0x17, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79,
0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6e, 0x65, 0x6f, 0x2e, 0x66,
0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x1a, 0x15, 0x72, 0x65, 0x66,
0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x22, 0x65, 0x0a, 0x0a, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f,
0x12, 0x28, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e,
0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x75,
0x62, 0x6e, 0x65, 0x74, 0x49, 0x44, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2d, 0x0a, 0x05, 0x6f, 0x77,
0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e,
0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72,
0x49, 0x44, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74,
0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72,
0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74,
0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x75, 0x62,
0x6e, 0x65, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0xaa,
0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67,
0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (
file_subnet_grpc_types_proto_rawDescOnce sync.Once
file_subnet_grpc_types_proto_rawDescData = file_subnet_grpc_types_proto_rawDesc
)
func file_subnet_grpc_types_proto_rawDescGZIP() []byte {
file_subnet_grpc_types_proto_rawDescOnce.Do(func() {
file_subnet_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_subnet_grpc_types_proto_rawDescData)
})
return file_subnet_grpc_types_proto_rawDescData
}
var file_subnet_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_subnet_grpc_types_proto_goTypes = []interface{}{
(*SubnetInfo)(nil), // 0: neo.fs.v2.subnet.SubnetInfo
(*grpc.SubnetID)(nil), // 1: neo.fs.v2.refs.SubnetID
(*grpc.OwnerID)(nil), // 2: neo.fs.v2.refs.OwnerID
}
var file_subnet_grpc_types_proto_depIdxs = []int32{
1, // 0: neo.fs.v2.subnet.SubnetInfo.id:type_name -> neo.fs.v2.refs.SubnetID
2, // 1: neo.fs.v2.subnet.SubnetInfo.owner:type_name -> neo.fs.v2.refs.OwnerID
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_subnet_grpc_types_proto_init() }
func file_subnet_grpc_types_proto_init() {
if File_subnet_grpc_types_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_subnet_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SubnetInfo); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_subnet_grpc_types_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_subnet_grpc_types_proto_goTypes,
DependencyIndexes: file_subnet_grpc_types_proto_depIdxs,
MessageInfos: file_subnet_grpc_types_proto_msgTypes,
}.Build()
File_subnet_grpc_types_proto = out.File
file_subnet_grpc_types_proto_rawDesc = nil
file_subnet_grpc_types_proto_goTypes = nil
file_subnet_grpc_types_proto_depIdxs = nil
}

View file

@ -1,138 +0,0 @@
package subnet
import (
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs"
refsgrpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc"
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message"
subnet "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/subnet/grpc"
protoutil "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto"
)
// Info represents information about NeoFS subnet. Structure is compatible with NeoFS API V2 protocol.
//
// Zero value represents zero subnet w/o an owner.
type Info struct {
id *refs.SubnetID
owner *refs.OwnerID
}
// ID returns identifier of the subnet. Nil return is equivalent to zero subnet ID.
func (x *Info) ID() *refs.SubnetID {
return x.id
}
// SetID returns identifier of the subnet. Nil arg is equivalent to zero subnet ID.
func (x *Info) SetID(id *refs.SubnetID) {
x.id = id
}
// Owner returns subnet owner's ID in NeoFS system.
func (x *Info) Owner() *refs.OwnerID {
return x.owner
}
// SetOwner sets subnet owner's ID in NeoFS system.
func (x *Info) SetOwner(id *refs.OwnerID) {
x.owner = id
}
// ToGRPCMessage forms subnet.SubnetInfo message and returns it as grpc.Message.
func (x *Info) ToGRPCMessage() grpc.Message {
var m *subnet.SubnetInfo
if x != nil {
m = new(subnet.SubnetInfo)
m.SetID(x.id.ToGRPCMessage().(*refsgrpc.SubnetID))
m.SetOwner(x.owner.ToGRPCMessage().(*refsgrpc.OwnerID))
}
return m
}
// FromGRPCMessage restores Info from grpc.Message.
//
// Supported types:
// - subnet.SubnetInfo.
func (x *Info) FromGRPCMessage(m grpc.Message) error {
v, ok := m.(*subnet.SubnetInfo)
if !ok {
return message.NewUnexpectedMessageType(m, v)
}
var err error
id := v.GetId()
if id == nil {
x.id = nil
} else {
if x.id == nil {
x.id = new(refs.SubnetID)
}
err = x.id.FromGRPCMessage(id)
if err != nil {
return err
}
}
ownerID := v.GetOwner()
if ownerID == nil {
x.owner = nil
} else {
if x.owner == nil {
x.owner = new(refs.OwnerID)
}
err = x.owner.FromGRPCMessage(ownerID)
if err != nil {
return err
}
}
return nil
}
// SubnetInfo message field numbers
const (
_ = iota
subnetInfoIDFNum
subnetInfoOwnerFNum
)
// StableMarshal marshals Info to NeoFS API V2 binary format (Protocol Buffers with direct field order).
//
// Returns a slice of recorded data. Data is written to the provided buffer if there is enough space.
func (x *Info) StableMarshal(buf []byte) []byte {
if x == nil {
return []byte{}
}
if buf == nil {
buf = make([]byte, x.StableSize())
}
var offset int
offset += protoutil.NestedStructureMarshal(subnetInfoIDFNum, buf[offset:], x.id)
protoutil.NestedStructureMarshal(subnetInfoOwnerFNum, buf[offset:], x.owner)
return buf
}
// StableSize returns the number of bytes required to write Info in NeoFS API V2 binary format (see StableMarshal).
func (x *Info) StableSize() (size int) {
if x != nil {
size += protoutil.NestedStructureSize(subnetInfoIDFNum, x.id)
size += protoutil.NestedStructureSize(subnetInfoOwnerFNum, x.owner)
}
return
}
// Unmarshal decodes Info from NeoFS API V2 binary format (see StableMarshal).
func (x *Info) Unmarshal(data []byte) error {
return message.Unmarshal(x, data, new(subnet.SubnetInfo))
}

View file

@ -1,17 +0,0 @@
package subnettest
import (
refstest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test"
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/subnet"
)
func GenerateSubnetInfo(empty bool) *subnet.Info {
m := new(subnet.Info)
if !empty {
m.SetID(refstest.GenerateSubnetID(false))
m.SetOwner(refstest.GenerateOwnerID(false))
}
return m
}