server

package
v0.0.0-...-4844297 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2019 License: GPL-3.0 Imports: 19 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 a remote connection into Tiles

func (*Client) Write

func (client *Client) Write(b []byte) (n int, err error)

Write writes on client output buffer

type Message

type Message struct {
	Args       []string
	ConnType   Type
	OutputType Type
	Auth       string
	// contains filtered or unexported fields
}

Message is a resp message

func (*Message) Command

func (msg *Message) Command() string

Command returns the first argument as a lowercase string

type PipelineReader

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

PipelineReader contains a source to parse the packets.

func (*PipelineReader) ReadMessages

func (rd *PipelineReader) ReadMessages() ([]*Message, error)

ReadMessages read from the reader and returns messages.

type Server

type Server struct {
	Threads int
	Host    string
	Port    int

	Config struct {
		KeepAlive time.Duration
	}
	// contains filtered or unexported fields
}

Server represents tiles (tile-shard) server.

func New

func New(threads int, host string, port int) *Server

New creates new server instance

func (*Server) AddNode

func (s *Server) AddNode(hash string, opts *redis.Options)

AddNode adds new destination node and its hash

func (*Server) Run

func (s *Server) Run() error

Run runs the server with event loop

type Type

type Type byte

Type is resp type

const (
	Null Type = iota
	RESP
	Telnet
	Native
	HTTP
	WebSocket
	JSON
)

Protocol Types

Jump to

Keyboard shortcuts

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