registry

package
v0.1.40 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: GPL-3.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

View Source
const (
	TypeWorker    = "worker"
	TypePBX       = "pbx"
	TypeTaskQueue = "taskQueue"
	TypeCron      = "cron"
	TypeFileStore = "fileStore"
	TypeQueue     = "queue"

	PortWorker    = "1234"
	PortPBX       = "1234"
	PortTaskQueue = "1234"
)

Services types consts

Variables

This section is empty.

Functions

func FSAddress added in v0.1.21

func FSAddress() string

FSAddress returns File Storage address if exists or empty string

func GetAll

func GetAll() map[string][]Service

GetAll returns all services from registry

func OnCreate

func OnCreate(fn func(Service))

OnCreate pass handler func, that will call when new service will created

func OnDelete

func OnDelete(fn func(Service))

OnDelete pass handler func, that will call when existing service will deleted

func OnUpdate

func OnUpdate(fn func(Service))

OnUpdate pass handler func, that will call when existing service will created

func Register

func Register(typ, remoteAddr, port, connID, commonJS string) (interface{}, error)

Register adds new service in registry

func Unregister

func Unregister(id string)

Unregister removes service from registry

Types

type RegisterMessage

type RegisterMessage struct {
	Type string `json:"type"`
}

type Service

type Service struct {
	Type     string `json:"type"`
	Address  string `json:"address"`
	Port     string `json:"port"`
	CommonJS string `json:"commonJS,omitempty"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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