nano: github.com/lonnng/nano/cluster Index | Files | Directories

package cluster

import "github.com/lonnng/nano/cluster"

Index

Package Files

acceptor.go agent.go cluster.go connpool.go const.go errors.go handler.go member.go node.go ws.go

Variables

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")
)
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.

type LocalHandler Uses

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

func NewHandler Uses

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

func (*LocalHandler) LocalService Uses

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

func (*LocalHandler) RemoteService Uses

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

type Member Uses

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

func (*Member) MemberInfo Uses

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

type Node Uses

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

Node represents a node in nano 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 Uses

func (n *Node) CloseSession(_ context.Context, req *clusterpb.CloseSessionRequest) (*clusterpb.CloseSessionResponse, error)

CloseSession implements the MemberServer interface

func (*Node) DelMember Uses

func (n *Node) DelMember(_ context.Context, req *clusterpb.DelMemberRequest) (*clusterpb.DelMemberResponse, error)

func (*Node) HandleNotify Uses

func (n *Node) HandleNotify(_ context.Context, req *clusterpb.NotifyMessage) (*clusterpb.MemberHandleResponse, error)

func (*Node) HandlePush Uses

func (n *Node) HandlePush(_ context.Context, req *clusterpb.PushMessage) (*clusterpb.MemberHandleResponse, error)

func (*Node) HandleRequest Uses

func (n *Node) HandleRequest(_ context.Context, req *clusterpb.RequestMessage) (*clusterpb.MemberHandleResponse, error)

func (*Node) HandleResponse Uses

func (n *Node) HandleResponse(_ context.Context, req *clusterpb.ResponseMessage) (*clusterpb.MemberHandleResponse, error)

func (*Node) Handler Uses

func (n *Node) Handler() *LocalHandler

func (*Node) NewMember Uses

func (n *Node) NewMember(_ context.Context, req *clusterpb.NewMemberRequest) (*clusterpb.NewMemberResponse, error)

func (*Node) SessionClosed Uses

func (n *Node) SessionClosed(_ context.Context, req *clusterpb.SessionClosedRequest) (*clusterpb.SessionClosedResponse, error)

SessionClosed implements the MemberServer interface

func (*Node) Shutdown Uses

func (n *Node) Shutdown()

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

func (*Node) Startup Uses

func (n *Node) Startup() error

type Options Uses

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

PathSynopsis
clusterpbPackage clusterpb is a generated protocol buffer package.

Package cluster imports 27 packages (graph). Updated 2020-12-31. Refresh now. Tools for package owners.