rpcproto

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2017 License: ISC Imports: 6 Imported by: 8

Documentation

Overview

Package rpcproto is a generated protocol buffer package.

It is generated from these files:

rpc.proto

It has these top-level messages:

GetIdentityRequest
GetIdentityReply
Object
SendObjectReply
GetObjectsRequest

Index

Constants

This section is empty.

Variables

View Source
var ObjectType_name = map[int32]string{
	0:  "GETPUBKEY",
	1:  "PUBKEY",
	2:  "MESSAGE",
	3:  "BROADCAST",
	99: "UNKNOWN",
}
View Source
var ObjectType_value = map[string]int32{
	"GETPUBKEY": 0,
	"PUBKEY":    1,
	"MESSAGE":   2,
	"BROADCAST": 3,
	"UNKNOWN":   99,
}

Functions

func RegisterBmdServer

func RegisterBmdServer(s *grpc.Server, srv BmdServer)

Types

type BasicAuthCredentials

type BasicAuthCredentials string

BasicAuthCredentials is used for sending credentials to gRPC server using Basic authentication method.

func NewBasicAuthCredentials

func NewBasicAuthCredentials(username, password string) BasicAuthCredentials

NewBasicAuthCredentials creates a new BasicAuthCredentials instance based on the provided username and password.

func (BasicAuthCredentials) GetRequestMetadata

func (cred BasicAuthCredentials) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error)

GetRequestMetadata implements the credentials.Credentials interface.

func (BasicAuthCredentials) RequireTransportSecurity

func (cred BasicAuthCredentials) RequireTransportSecurity() bool

type BmdClient

type BmdClient interface {
	// Retrieve the public identity of the given address. This is constructed from
	// public keys stored in the database. If the public key for the specified
	// address doesn't exist, an error is returned.
	GetIdentity(ctx context.Context, in *GetIdentityRequest, opts ...grpc.CallOption) (*GetIdentityReply, error)
	// Send the specified object onto the network. The object is first verified,
	// then inserted into bmd's database and advertised onto the network. Return
	// value is the counter value of the inserted object.
	SendObject(ctx context.Context, in *Object, opts ...grpc.CallOption) (*SendObjectReply, error)
	// Gets objects of the specified type that have their counter values starting
	// from what is specified. This method streams new objects until the stream
	// is closed. Objects are guaranteed to be in ascending order.
	GetObjects(ctx context.Context, in *GetObjectsRequest, opts ...grpc.CallOption) (Bmd_GetObjectsClient, error)
}

func NewBmdClient

func NewBmdClient(cc *grpc.ClientConn) BmdClient

type BmdServer

type BmdServer interface {
	// Retrieve the public identity of the given address. This is constructed from
	// public keys stored in the database. If the public key for the specified
	// address doesn't exist, an error is returned.
	GetIdentity(context.Context, *GetIdentityRequest) (*GetIdentityReply, error)
	// Send the specified object onto the network. The object is first verified,
	// then inserted into bmd's database and advertised onto the network. Return
	// value is the counter value of the inserted object.
	SendObject(context.Context, *Object) (*SendObjectReply, error)
	// Gets objects of the specified type that have their counter values starting
	// from what is specified. This method streams new objects until the stream
	// is closed. Objects are guaranteed to be in ascending order.
	GetObjects(*GetObjectsRequest, Bmd_GetObjectsServer) error
}

type Bmd_GetObjectsClient

type Bmd_GetObjectsClient interface {
	Recv() (*Object, error)
	grpc.ClientStream
}

type Bmd_GetObjectsServer

type Bmd_GetObjectsServer interface {
	Send(*Object) error
	grpc.ServerStream
}

type GetIdentityReply

type GetIdentityReply struct {
	// Nonce Trials Per Byte: POW parameter.
	NonceTrials uint64 `protobuf:"varint,1,opt,name=nonce_trials,json=nonceTrials" json:"nonce_trials,omitempty"`
	// Extra bytes: POW parameter.
	ExtraBytes uint64 `protobuf:"varint,2,opt,name=extra_bytes,json=extraBytes" json:"extra_bytes,omitempty"`
	// Uncompressed secp256k1 public key.
	SigningKey []byte `protobuf:"bytes,3,opt,name=signing_key,json=signingKey,proto3" json:"signing_key,omitempty"`
	// Uncompressed secp256k1 public key.
	EncryptionKey []byte `protobuf:"bytes,4,opt,name=encryption_key,json=encryptionKey,proto3" json:"encryption_key,omitempty"`
	Behavior      uint32 `protobuf:"varint,5,opt,name=behavior" json:"behavior,omitempty"`
}

func (*GetIdentityReply) Descriptor

func (*GetIdentityReply) Descriptor() ([]byte, []int)

func (*GetIdentityReply) ProtoMessage

func (*GetIdentityReply) ProtoMessage()

func (*GetIdentityReply) Reset

func (m *GetIdentityReply) Reset()

func (*GetIdentityReply) String

func (m *GetIdentityReply) String() string

type GetIdentityRequest

type GetIdentityRequest struct {
	// A properly formatted Bitmessage address.
	Address string `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"`
}

func (*GetIdentityRequest) Descriptor

func (*GetIdentityRequest) Descriptor() ([]byte, []int)

func (*GetIdentityRequest) ProtoMessage

func (*GetIdentityRequest) ProtoMessage()

func (*GetIdentityRequest) Reset

func (m *GetIdentityRequest) Reset()

func (*GetIdentityRequest) String

func (m *GetIdentityRequest) String() string

type GetObjectsRequest

type GetObjectsRequest struct {
	// Type of object the client wants to receive.
	ObjectType ObjectType `protobuf:"varint,1,opt,name=object_type,json=objectType,enum=ObjectType" json:"object_type,omitempty"`
	// Counter value the server should start sending object messages from.
	FromCounter uint64 `protobuf:"varint,2,opt,name=from_counter,json=fromCounter" json:"from_counter,omitempty"`
}

func (*GetObjectsRequest) Descriptor

func (*GetObjectsRequest) Descriptor() ([]byte, []int)

func (*GetObjectsRequest) ProtoMessage

func (*GetObjectsRequest) ProtoMessage()

func (*GetObjectsRequest) Reset

func (m *GetObjectsRequest) Reset()

func (*GetObjectsRequest) String

func (m *GetObjectsRequest) String() string

type Object

type Object struct {
	// Properly serialized object bytes. It includes the object header (but not
	// the Bitmessage message header).
	Contents []byte `protobuf:"bytes,1,opt,name=contents,proto3" json:"contents,omitempty"`
	// Counter value of the object, as in bmd's database. It is ignored with
	// SendObject.
	Counter uint64 `protobuf:"varint,2,opt,name=counter" json:"counter,omitempty"`
}

func (*Object) Descriptor

func (*Object) Descriptor() ([]byte, []int)

func (*Object) ProtoMessage

func (*Object) ProtoMessage()

func (*Object) Reset

func (m *Object) Reset()

func (*Object) String

func (m *Object) String() string

type ObjectType

type ObjectType int32

ObjectType is an enum which contains various types of objects.

const (
	ObjectType_GETPUBKEY ObjectType = 0
	ObjectType_PUBKEY    ObjectType = 1
	ObjectType_MESSAGE   ObjectType = 2
	ObjectType_BROADCAST ObjectType = 3
	ObjectType_UNKNOWN   ObjectType = 99
)

func (ObjectType) EnumDescriptor

func (ObjectType) EnumDescriptor() ([]byte, []int)

func (ObjectType) String

func (x ObjectType) String() string

type SendObjectReply

type SendObjectReply struct {
	// Counter value of the object, as inserted in bmd's database.
	Counter uint64 `protobuf:"varint,1,opt,name=counter" json:"counter,omitempty"`
}

func (*SendObjectReply) Descriptor

func (*SendObjectReply) Descriptor() ([]byte, []int)

func (*SendObjectReply) ProtoMessage

func (*SendObjectReply) ProtoMessage()

func (*SendObjectReply) Reset

func (m *SendObjectReply) Reset()

func (*SendObjectReply) String

func (m *SendObjectReply) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL