Skip to content
Permalink
Browse files

Add featurebit mechanism

Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
  • Loading branch information...
puiterwijk authored and mergify committed Mar 26, 2019
1 parent 9764a01 commit 351fb92568f5b3726324500f89deb890ec575219
@@ -1,4 +1,4 @@
//go:generate protoc -I ../../server/protobuf --go_out=../../server/protobuf ../../server/protobuf/pushrequest.proto
//go:generate protoc -I ../../server/protobuf --go_out=../../server/protobuf ../../server/protobuf/pushrequest.proto ../../server/protobuf/pingmessage.proto

package main

@@ -0,0 +1,16 @@
package protobuf

// FeatureBit is the type for feature bits
type FeatureBit uint64

const ()

// HasFeature returns whether a particular bit is set in the ping message
func (p *PingMessage) HasFeature(feature FeatureBit) bool {
return p.GetFeatureBits()&uint64(feature) != 0
}

// SupportedFeatures returns the set of features supported by this build
func SupportedFeatures() uint64 {
return uint64(0)
}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -0,0 +1,10 @@
syntax = "proto2";

package protobuf;

message PingMessage {
required uint64 pingnode = 1;
required int64 timestamp = 2;
required uint64 appliedIndex = 3;
optional uint64 featureBits = 4;
}
Oops, something went wrong.

0 comments on commit 351fb92

Please sign in to comment.
You can’t perform that action at this time.