linkcache

package
v1.2.12 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ServiceLinkNum topic service link num
	ServiceLinkNum = "topic_service_link_num"
)

Variables

This section is empty.

Functions

func EncodeDownMsg

func EncodeDownMsg(id string, service string, addr string) *mailbox.Message

EncodeDownMsg encode down msg

func EncodeLinkNumMsg

func EncodeLinkNumMsg(id string, num int) *mailbox.Message

EncodeLinkNumMsg encode linknum msg

Types

type DownMsg

type DownMsg struct {
	ID      string
	Service string
	Addr    string
}

DownMsg down msg

func DecodeDownMsg

func DecodeDownMsg(msg *mailbox.Message) DownMsg

DecodeDownMsg decode down msg

type ILinkCache

type ILinkCache interface {
	module.IModule

	// Look for existing links from the cache
	Target(token string, serviceName string) (targetAddr string, err error)

	// 将token绑定到nod
	Link(token string, target discover.Node) error

	// unlink token
	Unlink(token string, target string) error

	// clean up the service
	Down(target discover.Node) error
}

ILinkCache The connector is a service that maintains the link relationship between multiple processes and users.

+---parent----------+ | | | +--child----+ | | | | | | | token ... | | | | | | | +-----------+ | | | +-------------------+

type LinkNumMsg

type LinkNumMsg struct {
	ID  string
	Num int
}

LinkNumMsg msg struct

func DecodeLinkNumMsg

func DecodeLinkNumMsg(msg *mailbox.Message) LinkNumMsg

DecodeLinkNumMsg decode linknum msg

Jump to

Keyboard shortcuts

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