api

package
v0.0.0-...-3c07d78 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2020 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func RegisterEchoServer

func RegisterEchoServer(s *grpc.Server, srv EchoServer)

Types

type EchoClient

type EchoClient interface {
	Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error)
	StreamEcho(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (Echo_StreamEchoClient, error)
	FailingEcho(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error)
	IsLeader(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*IsLeaderResponse, error)
}

EchoClient is the client API for Echo service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewEchoClient

func NewEchoClient(cc grpc.ClientConnInterface) EchoClient

type EchoRequest

type EchoRequest struct {

	// A client_id
	ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	// contains filtered or unexported fields
}

func (*EchoRequest) Descriptor deprecated

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

Deprecated: Use EchoRequest.ProtoReflect.Descriptor instead.

func (*EchoRequest) GetClientId

func (x *EchoRequest) GetClientId() string

func (*EchoRequest) ProtoMessage

func (*EchoRequest) ProtoMessage()

func (*EchoRequest) ProtoReflect

func (x *EchoRequest) ProtoReflect() protoreflect.Message

func (*EchoRequest) Reset

func (x *EchoRequest) Reset()

func (*EchoRequest) String

func (x *EchoRequest) String() string

type EchoResponse

type EchoResponse struct {

	// server id
	ServerId string `protobuf:"bytes,1,opt,name=server_id,json=serverId,proto3" json:"server_id,omitempty"`
	// client id which made that request
	ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	// clock time at server
	Clock int64 `protobuf:"varint,3,opt,name=clock,proto3" json:"clock,omitempty"`
	// contains filtered or unexported fields
}

func (*EchoResponse) Descriptor deprecated

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

Deprecated: Use EchoResponse.ProtoReflect.Descriptor instead.

func (*EchoResponse) GetClientId

func (x *EchoResponse) GetClientId() string

func (*EchoResponse) GetClock

func (x *EchoResponse) GetClock() int64

func (*EchoResponse) GetServerId

func (x *EchoResponse) GetServerId() string

func (*EchoResponse) ProtoMessage

func (*EchoResponse) ProtoMessage()

func (*EchoResponse) ProtoReflect

func (x *EchoResponse) ProtoReflect() protoreflect.Message

func (*EchoResponse) Reset

func (x *EchoResponse) Reset()

func (*EchoResponse) String

func (x *EchoResponse) String() string

type EchoServer

type EchoServer interface {
	Echo(context.Context, *EchoRequest) (*EchoResponse, error)
	StreamEcho(*EchoRequest, Echo_StreamEchoServer) error
	FailingEcho(context.Context, *EchoRequest) (*EchoResponse, error)
	IsLeader(context.Context, *Empty) (*IsLeaderResponse, error)
}

EchoServer is the server API for Echo service.

type Echo_StreamEchoClient

type Echo_StreamEchoClient interface {
	Recv() (*EchoResponse, error)
	grpc.ClientStream
}

type Echo_StreamEchoServer

type Echo_StreamEchoServer interface {
	Send(*EchoResponse) error
	grpc.ServerStream
}

type Empty

type Empty struct {
	// contains filtered or unexported fields
}

func (*Empty) Descriptor deprecated

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

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

func (x *Empty) ProtoReflect() protoreflect.Message

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type IsLeaderResponse

type IsLeaderResponse struct {

	// is leader or not
	IsLeader bool `protobuf:"varint,1,opt,name=is_leader,json=isLeader,proto3" json:"is_leader,omitempty"`
	// contains filtered or unexported fields
}

func (*IsLeaderResponse) Descriptor deprecated

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

Deprecated: Use IsLeaderResponse.ProtoReflect.Descriptor instead.

func (*IsLeaderResponse) GetIsLeader

func (x *IsLeaderResponse) GetIsLeader() bool

func (*IsLeaderResponse) ProtoMessage

func (*IsLeaderResponse) ProtoMessage()

func (*IsLeaderResponse) ProtoReflect

func (x *IsLeaderResponse) ProtoReflect() protoreflect.Message

func (*IsLeaderResponse) Reset

func (x *IsLeaderResponse) Reset()

func (*IsLeaderResponse) String

func (x *IsLeaderResponse) String() string

type UnimplementedEchoServer

type UnimplementedEchoServer struct {
}

UnimplementedEchoServer can be embedded to have forward compatible implementations.

func (*UnimplementedEchoServer) Echo

func (*UnimplementedEchoServer) FailingEcho

func (*UnimplementedEchoServer) IsLeader

func (*UnimplementedEchoServer) StreamEcho

Jump to

Keyboard shortcuts

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