server

package
v0.0.0-...-c0a90d8 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2017 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is used to connect and request to other brokers, for example for replication.

func NewClient

func NewClient(conn io.ReadWriter) *Client

NewClient creates a new client to a Jocko server that can be reached over conn.

func (*Client) CreateTopic

func (p *Client) CreateTopic(clientID string, createRequest *protocol.CreateTopicRequest) (*protocol.CreateTopicsResponse, error)

CreateTopic sends request to server to create a topic as per createRequest

func (*Client) FetchMessages

func (p *Client) FetchMessages(clientID string, fetchRequest *protocol.FetchRequest) (*protocol.FetchResponses, error)

FetchMessages of topics from server as per fetchRequest

type Server

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

Server is used to handle the TCP connections, decode requests, defer to the broker, and encode the responses.

func New

func New(protocolAddr string, broker jocko.Broker, httpAddr string, metrics *jocko.Metrics, logger log.Logger) *Server

func (*Server) Addr

func (s *Server) Addr() net.Addr

Addr returns the address on which the Server is listening

func (*Server) Close

func (s *Server) Close()

Close closes the service.

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start starts the service.

Jump to

Keyboard shortcuts

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