hub

package
v0.0.0-...-97b8310 Latest Latest
Warning

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

Go to latest
Published: May 5, 2018 License: BSD-2-Clause Imports: 14 Imported by: 0

Documentation

Overview

Package hub is a generated protocol buffer package.

It is generated from these files:

hub.proto

It has these top-level messages:

PutRequest
PutResponse
GetRequest
GetResponse
Message

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHubServer

func RegisterHubServer(s *grpc.Server, srv HubServer)

Types

type Client

type Client struct {
	Addr       string
	ClientID   string
	JournalDir string
	Timeout    time.Duration
	// contains filtered or unexported fields
}

func (*Client) Close

func (c *Client) Close() error

func (*Client) Send

func (c *Client) Send(messages []sej.Message) error

type GetRequest

type GetRequest struct {
	ClientID   string `protobuf:"bytes,1,opt,name=ClientID" json:"ClientID,omitempty"`
	JournalDir string `protobuf:"bytes,2,opt,name=JournalDir" json:"JournalDir,omitempty"`
	Offset     uint64 `protobuf:"varint,3,opt,name=Offset" json:"Offset,omitempty"`
}

func (*GetRequest) Descriptor

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

func (*GetRequest) GetClientID

func (m *GetRequest) GetClientID() string

func (*GetRequest) GetJournalDir

func (m *GetRequest) GetJournalDir() string

func (*GetRequest) GetOffset

func (m *GetRequest) GetOffset() uint64

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) Reset

func (m *GetRequest) Reset()

func (*GetRequest) String

func (m *GetRequest) String() string

type GetResponse

type GetResponse struct {
	Messages []*Message `protobuf:"bytes,1,rep,name=Messages" json:"Messages,omitempty"`
}

func (*GetResponse) Descriptor

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

func (*GetResponse) GetMessages

func (m *GetResponse) GetMessages() []*Message

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) Reset

func (m *GetResponse) Reset()

func (*GetResponse) String

func (m *GetResponse) String() string

type Handler

type Handler interface {
	Put(ctx context.Context, req *PutRequest) (*PutResponse, error)
	Get(ctx context.Context, req *GetRequest) (*GetResponse, error)
}

type HubClient

type HubClient interface {
	Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error)
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
}

func NewHubClient

func NewHubClient(cc *grpc.ClientConn) HubClient

type HubServer

type HubServer interface {
	Put(context.Context, *PutRequest) (*PutResponse, error)
	Get(context.Context, *GetRequest) (*GetResponse, error)
}

type JournalCopyHandler

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

func NewJournalCopyHandler

func NewJournalCopyHandler(dir string) *JournalCopyHandler

func (*JournalCopyHandler) Get

func (*JournalCopyHandler) Put

type Message

type Message struct {
	Offset    uint64 `protobuf:"varint,1,opt,name=Offset" json:"Offset,omitempty"`
	Timestamp int64  `protobuf:"varint,2,opt,name=Timestamp" json:"Timestamp,omitempty"`
	Type      uint32 `protobuf:"varint,3,opt,name=Type" json:"Type,omitempty"`
	Key       []byte `protobuf:"bytes,4,opt,name=Key,proto3" json:"Key,omitempty"`
	Value     []byte `protobuf:"bytes,5,opt,name=Value,proto3" json:"Value,omitempty"`
}

func (*Message) Descriptor

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

func (*Message) GetKey

func (m *Message) GetKey() []byte

func (*Message) GetOffset

func (m *Message) GetOffset() uint64

func (*Message) GetTimestamp

func (m *Message) GetTimestamp() int64

func (*Message) GetType

func (m *Message) GetType() uint32

func (*Message) GetValue

func (m *Message) GetValue() []byte

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) Reset

func (m *Message) Reset()

func (*Message) String

func (m *Message) String() string

type PutRequest

type PutRequest struct {
	ClientID   string     `protobuf:"bytes,1,opt,name=ClientID" json:"ClientID,omitempty"`
	JournalDir string     `protobuf:"bytes,2,opt,name=JournalDir" json:"JournalDir,omitempty"`
	Messages   []*Message `protobuf:"bytes,3,rep,name=Messages" json:"Messages,omitempty"`
}

func (*PutRequest) Descriptor

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

func (*PutRequest) GetClientID

func (m *PutRequest) GetClientID() string

func (*PutRequest) GetJournalDir

func (m *PutRequest) GetJournalDir() string

func (*PutRequest) GetMessages

func (m *PutRequest) GetMessages() []*Message

func (*PutRequest) ProtoMessage

func (*PutRequest) ProtoMessage()

func (*PutRequest) Reset

func (m *PutRequest) Reset()

func (*PutRequest) String

func (m *PutRequest) String() string

type PutResponse

type PutResponse struct {
}

func (*PutResponse) Descriptor

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

func (*PutResponse) ProtoMessage

func (*PutResponse) ProtoMessage()

func (*PutResponse) Reset

func (m *PutResponse) Reset()

func (*PutResponse) String

func (m *PutResponse) String() string

type Server

type Server struct {
	Addr    string
	Timeout time.Duration
	// ErrChan chan error
	LogChan chan string

	Handler
	// contains filtered or unexported fields
}

func (*Server) Close

func (s *Server) Close() error

func (*Server) Start

func (s *Server) Start() error

Jump to

Keyboard shortcuts

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