gonode

package module
v0.0.0-...-9ae062e Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: Apache-2.0 Imports: 14 Imported by: 12

README

gonode

a service node based on go

Documentation

Index

Constants

View Source
const (
	// version
	VERSION string = "v0.9.0.1"
	// reg channel
	CHAN_REG string = "gonode_reg"
	// log channel
	CHAN_LOG string = "gonode_log"
	// monitor channel
	CHAN_MONI string = "gonode_moni"
	// the supervisor role
	SUPERVISOR string = "supervisor"
	// when you set the backends to allnodes,
	// the node will try to conn to everynode in the cluster
	ALLNODES string = "allnodes"
)

Variables

This section is empty.

Functions

func Bind

func Bind(behavior gen_server.GenServer)

func BindLogger

func BindLogger(logWriter logger.LogWriter, logLevel int)

func BindMonitor

func BindMonitor(monitor monitor.GenMonitor)

func Close

func Close(id string) error

func Connect

func Connect(nickid string, url string) error

func CustomError

func CustomError(errcode int, errmsg string) error

func Debug

func Debug(arg0 interface{}, args ...interface{})

func ErrorInfo

func ErrorInfo(err error) (int, string)

func GetNodeInfo

func GetNodeInfo(id string) (*gen_server.NodeInfo, error)

func GetNodeStatus

func GetNodeStatus(id string, ref interface{}) error

func Info

func Info() *gen_server.NodeInfo

func IsPeer

func IsPeer(id string) bool

func Label

func Label(id string) string

func Launch

func Launch()

func Listen

func Listen(url string)

func LogError

func LogError(arg0 interface{}, args ...interface{})

func LogInfo

func LogInfo(arg0 interface{}, args ...interface{})

func LogSource

func LogSource(callstack int) string

func LogWarn

func LogWarn(arg0 interface{}, args ...interface{})

func Nodes

func Nodes(label string) []string

func Self

func Self() string

func Send

func Send(id string, msg []byte) error

func SendAll

func SendAll(ids []string, msg []byte) []error

func Supervise

func Supervise(super supervisor.Supervisor) error

Types

type EventHandler

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

func (*EventHandler) OnCheckNode

func (e *EventHandler) OnCheckNode(origin string) (string, bool)

func (*EventHandler) OnClose

func (e *EventHandler) OnClose(id string, reason error)

func (*EventHandler) OnConn

func (e *EventHandler) OnConn(id string)

func (*EventHandler) OnDCError

func (e *EventHandler) OnDCError(err error)

func (*EventHandler) OnDigestError

func (e *EventHandler) OnDigestError(err interface{})

func (*EventHandler) OnError

func (e *EventHandler) OnError(id string, err error)

func (*EventHandler) OnMsg

func (e *EventHandler) OnMsg(id string, msg []byte)

func (*EventHandler) OnNewNode

func (e *EventHandler) OnNewNode(id string) error

func (*EventHandler) OnUnregister

func (e *EventHandler) OnUnregister(id string)

func (*EventHandler) OnUpdateNodeStatus

func (e *EventHandler) OnUpdateNodeStatus() interface{}

type GoNode

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

func (*GoNode) Bind

func (g *GoNode) Bind(behavior gen_server.GenServer)

func (*GoNode) BindLogger

func (g *GoNode) BindLogger(logWriter logger.LogWriter, logLevel int)

func (*GoNode) BindMonitor

func (g *GoNode) BindMonitor(monitor monitor.GenMonitor)

func (*GoNode) Close

func (g *GoNode) Close(id string) error

func (*GoNode) Connnect

func (g *GoNode) Connnect(nodeId string, url string) error

func (*GoNode) Info

func (g *GoNode) Info() *gen_server.NodeInfo

func (*GoNode) Launch

func (g *GoNode) Launch()

func (*GoNode) Listen

func (g *GoNode) Listen(url string)

func (*GoNode) Logger

func (g *GoNode) Logger() *logger.Logger

func (*GoNode) Origin

func (g *GoNode) Origin() string

func (*GoNode) Self

func (g *GoNode) Self() string

func (*GoNode) Send

func (g *GoNode) Send(id string, msg []byte) error

func (*GoNode) SendAll

func (g *GoNode) SendAll(ids []string, msg []byte) []error

func (*GoNode) Supervise

func (g *GoNode) Supervise(super supervisor.Supervisor) error

Directories

Path Synopsis
behaviors
core
utils
gz
ini
io
os
rsa
stl
ts

Jump to

Keyboard shortcuts

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