cluster

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBrokenPipe represents the low-level connection has broken.
	ErrBrokenPipe = errors.New("broken low-level pipe")
	// ErrBufferExceed indicates that the current session buffer is full and
	// can not receive more data.
	ErrBufferExceed = errors.New("session send buffer exceed")
)
View Source
var (
	ErrSessionOnNotify    = errors.New("current session working on notify mode")
	ErrCloseClosedSession = errors.New("close closed session")
	ErrInvalidRegisterReq = errors.New("invalid register request")
)

Errors that could be occurred during message handling.

Functions

This section is empty.

Types

type LocalHandler

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

func NewHandler

func NewHandler(currentNode *Node, pipeline pipeline.Pipeline) *LocalHandler

func (*LocalHandler) LocalService

func (h *LocalHandler) LocalService() []string

func (*LocalHandler) RemoteService

func (h *LocalHandler) RemoteService() []string

type Member

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

func (*Member) MemberInfo

func (m *Member) MemberInfo() *clusterpb.MemberInfo

type Node

type Node struct {
	Options            // current node options
	ServiceAddr string // current server service address (RPC)
	// contains filtered or unexported fields
}

Node represents a node in ngs cluster, which will contains a group of services. All services will register to cluster and messages will be forwarded to the node which provides respective service

func (*Node) CloseSession

CloseSession implements the MemberServer interface

func (*Node) DelMember

func (*Node) HandleNotify

func (*Node) HandlePush

func (*Node) HandleRequest

func (*Node) HandleResponse

func (*Node) Handler

func (n *Node) Handler() *LocalHandler

func (*Node) NewMember

func (*Node) SessionClosed

SessionClosed implements the MemberServer interface

func (*Node) Shutdown

func (n *Node) Shutdown()

Shutdowns all components registered by application, that call by reverse order against register

func (*Node) Startup

func (n *Node) Startup() error

type Options

type Options struct {
	Pipeline       pipeline.Pipeline
	IsMaster       bool
	AdvertiseAddr  string
	RetryInterval  time.Duration
	ClientAddr     string
	Components     *component.Components
	Label          string
	IsWebsocket    bool
	TSLCertificate string
	TSLKey         string
}

Options contains some configurations for current node

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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