grpc

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2019 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthClock = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowClock   = fmt.Errorf("proto: integer overflow")
)

Functions

func RegisterClockServer

func RegisterClockServer(s *grpc.Server, srv ClockServer)

Types

type ClockClient

type ClockClient interface {
	// Returns the local time.
	Local(ctx context.Context, in *LocalReq, opts ...grpc.CallOption) (*Time, error)
	// Returns a peer's remote time.
	Remote(ctx context.Context, in *RemoteReq, opts ...grpc.CallOption) (*Time, error)
}

func NewClockClient

func NewClockClient(cc *grpc.ClientConn) ClockClient

type ClockServer

type ClockServer interface {
	// Returns the local time.
	Local(context.Context, *LocalReq) (*Time, error)
	// Returns a peer's remote time.
	Remote(context.Context, *RemoteReq) (*Time, error)
}

type LocalReq

type LocalReq struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The Local request message.

func (*LocalReq) Descriptor

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

func (*LocalReq) Marshal

func (m *LocalReq) Marshal() (dAtA []byte, err error)

func (*LocalReq) MarshalTo

func (m *LocalReq) MarshalTo(dAtA []byte) (int, error)

func (*LocalReq) ProtoMessage

func (*LocalReq) ProtoMessage()

func (*LocalReq) Reset

func (m *LocalReq) Reset()

func (*LocalReq) Size

func (m *LocalReq) Size() (n int)

func (*LocalReq) String

func (m *LocalReq) String() string

func (*LocalReq) Unmarshal

func (m *LocalReq) Unmarshal(dAtA []byte) error

func (*LocalReq) XXX_DiscardUnknown added in v0.2.0

func (m *LocalReq) XXX_DiscardUnknown()

func (*LocalReq) XXX_Marshal added in v0.2.0

func (m *LocalReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LocalReq) XXX_Merge added in v0.2.0

func (dst *LocalReq) XXX_Merge(src proto.Message)

func (*LocalReq) XXX_Size added in v0.2.0

func (m *LocalReq) XXX_Size() int

func (*LocalReq) XXX_Unmarshal added in v0.2.0

func (m *LocalReq) XXX_Unmarshal(b []byte) error

type RemoteReq

type RemoteReq struct {
	PeerId               []byte   `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The Remote request message.

func (*RemoteReq) Descriptor

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

func (*RemoteReq) GetPeerId

func (m *RemoteReq) GetPeerId() []byte

func (*RemoteReq) Marshal

func (m *RemoteReq) Marshal() (dAtA []byte, err error)

func (*RemoteReq) MarshalTo

func (m *RemoteReq) MarshalTo(dAtA []byte) (int, error)

func (*RemoteReq) ProtoMessage

func (*RemoteReq) ProtoMessage()

func (*RemoteReq) Reset

func (m *RemoteReq) Reset()

func (*RemoteReq) Size

func (m *RemoteReq) Size() (n int)

func (*RemoteReq) String

func (m *RemoteReq) String() string

func (*RemoteReq) Unmarshal

func (m *RemoteReq) Unmarshal(dAtA []byte) error

func (*RemoteReq) XXX_DiscardUnknown added in v0.2.0

func (m *RemoteReq) XXX_DiscardUnknown()

func (*RemoteReq) XXX_Marshal added in v0.2.0

func (m *RemoteReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RemoteReq) XXX_Merge added in v0.2.0

func (dst *RemoteReq) XXX_Merge(src proto.Message)

func (*RemoteReq) XXX_Size added in v0.2.0

func (m *RemoteReq) XXX_Size() int

func (*RemoteReq) XXX_Unmarshal added in v0.2.0

func (m *RemoteReq) XXX_Unmarshal(b []byte) error

type Time

type Time struct {
	Timestamp            int64    `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The time message containing a Unix nano timestamp.

func (*Time) Descriptor

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

func (*Time) GetTimestamp

func (m *Time) GetTimestamp() int64

func (*Time) Marshal

func (m *Time) Marshal() (dAtA []byte, err error)

func (*Time) MarshalTo

func (m *Time) MarshalTo(dAtA []byte) (int, error)

func (*Time) ProtoMessage

func (*Time) ProtoMessage()

func (*Time) Reset

func (m *Time) Reset()

func (*Time) Size

func (m *Time) Size() (n int)

func (*Time) String

func (m *Time) String() string

func (*Time) Unmarshal

func (m *Time) Unmarshal(dAtA []byte) error

func (*Time) XXX_DiscardUnknown added in v0.2.0

func (m *Time) XXX_DiscardUnknown()

func (*Time) XXX_Marshal added in v0.2.0

func (m *Time) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Time) XXX_Merge added in v0.2.0

func (dst *Time) XXX_Merge(src proto.Message)

func (*Time) XXX_Size added in v0.2.0

func (m *Time) XXX_Size() int

func (*Time) XXX_Unmarshal added in v0.2.0

func (m *Time) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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