Documentation
¶
Index ¶
- func RegisterVoterQueryServer(s *grpc.Server, srv VoterQueryServer)
- type OpinionRetriever
- type QueryReply
- func (*QueryReply) Descriptor() ([]byte, []int)
- func (m *QueryReply) GetOpinion() []int32
- func (*QueryReply) ProtoMessage()
- func (m *QueryReply) Reset()
- func (m *QueryReply) String() string
- func (m *QueryReply) XXX_DiscardUnknown()
- func (m *QueryReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryReply) XXX_Merge(src proto.Message)
- func (m *QueryReply) XXX_Size() int
- func (m *QueryReply) XXX_Unmarshal(b []byte) error
- type QueryRequest
- func (*QueryRequest) Descriptor() ([]byte, []int)
- func (m *QueryRequest) GetId() []string
- func (*QueryRequest) ProtoMessage()
- func (m *QueryRequest) Reset()
- func (m *QueryRequest) String() string
- func (m *QueryRequest) XXX_DiscardUnknown()
- func (m *QueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryRequest) XXX_Merge(src proto.Message)
- func (m *QueryRequest) XXX_Size() int
- func (m *QueryRequest) XXX_Unmarshal(b []byte) error
- type UnimplementedVoterQueryServer
- type VoterQueryClient
- type VoterQueryServer
- type VoterServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterVoterQueryServer ¶
func RegisterVoterQueryServer(s *grpc.Server, srv VoterQueryServer)
Types ¶
type OpinionRetriever ¶
OpinionRetriever retrieves the opinion for the given ID. If there's no opinion, the function should return Unknown.
type QueryReply ¶
type QueryReply struct {
Opinion []int32 `protobuf:"varint,1,rep,packed,name=opinion,proto3" json:"opinion,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*QueryReply) Descriptor ¶
func (*QueryReply) Descriptor() ([]byte, []int)
func (*QueryReply) GetOpinion ¶
func (m *QueryReply) GetOpinion() []int32
func (*QueryReply) ProtoMessage ¶
func (*QueryReply) ProtoMessage()
func (*QueryReply) Reset ¶
func (m *QueryReply) Reset()
func (*QueryReply) String ¶
func (m *QueryReply) String() string
func (*QueryReply) XXX_DiscardUnknown ¶
func (m *QueryReply) XXX_DiscardUnknown()
func (*QueryReply) XXX_Marshal ¶
func (m *QueryReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryReply) XXX_Merge ¶
func (m *QueryReply) XXX_Merge(src proto.Message)
func (*QueryReply) XXX_Size ¶
func (m *QueryReply) XXX_Size() int
func (*QueryReply) XXX_Unmarshal ¶
func (m *QueryReply) XXX_Unmarshal(b []byte) error
type QueryRequest ¶
type QueryRequest struct {
Id []string `protobuf:"bytes,1,rep,name=id,proto3" json:"id,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*QueryRequest) Descriptor ¶
func (*QueryRequest) Descriptor() ([]byte, []int)
func (*QueryRequest) GetId ¶
func (m *QueryRequest) GetId() []string
func (*QueryRequest) ProtoMessage ¶
func (*QueryRequest) ProtoMessage()
func (*QueryRequest) Reset ¶
func (m *QueryRequest) Reset()
func (*QueryRequest) String ¶
func (m *QueryRequest) String() string
func (*QueryRequest) XXX_DiscardUnknown ¶
func (m *QueryRequest) XXX_DiscardUnknown()
func (*QueryRequest) XXX_Marshal ¶
func (m *QueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryRequest) XXX_Merge ¶
func (m *QueryRequest) XXX_Merge(src proto.Message)
func (*QueryRequest) XXX_Size ¶
func (m *QueryRequest) XXX_Size() int
func (*QueryRequest) XXX_Unmarshal ¶
func (m *QueryRequest) XXX_Unmarshal(b []byte) error
type UnimplementedVoterQueryServer ¶
type UnimplementedVoterQueryServer struct {
}
UnimplementedVoterQueryServer can be embedded to have forward compatible implementations.
func (*UnimplementedVoterQueryServer) Opinion ¶
func (*UnimplementedVoterQueryServer) Opinion(ctx context.Context, req *QueryRequest) (*QueryReply, error)
type VoterQueryClient ¶
type VoterQueryClient interface {
Opinion(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryReply, error)
}
VoterQueryClient is the client API for VoterQuery service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewVoterQueryClient ¶
func NewVoterQueryClient(cc grpc.ClientConnInterface) VoterQueryClient
type VoterQueryServer ¶
type VoterQueryServer interface {
Opinion(context.Context, *QueryRequest) (*QueryReply, error)
}
VoterQueryServer is the server API for VoterQuery service.
type VoterServer ¶
type VoterServer struct {
// contains filtered or unexported fields
}
VoterServer is a server which responds to opinion queries.
func New ¶
func New(voter vote.Voter, opnRetriever OpinionRetriever, bindAddr string, netRxEvent, netTxEvent, queryReceivedEvent *events.Event) *VoterServer
New creates a new VoterServer.
func (*VoterServer) Opinion ¶
func (vs *VoterServer) Opinion(ctx context.Context, req *QueryRequest) (*QueryReply, error)
func (*VoterServer) Run ¶
func (vs *VoterServer) Run() error
func (*VoterServer) Shutdown ¶
func (vs *VoterServer) Shutdown()
Click to show internal directories.
Click to hide internal directories.