reg

package
v0.0.0-...-197f44b Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

package reg

Index

Constants

This section is empty.

Variables

View Source
var (
	ExpirationTime = time.Second * 30 // 30s
)

Functions

func Free

func Free(instanceId string)

Free sets registered instance state to FREE so it can be detected by timer expiration job.

func InitRegistry

func InitRegistry()

InitRegistry starts a timer job for instance expiration detection in a single goroutine.

func InstanceSetSnapshot

func InstanceSetSnapshot() map[string]*common.Instance

InstanceSetSnapshot takes a snapshot for current instances.

func Put

func Put(ins *common.Instance) error

Put registers a new Instance.

It returns an error if the new Instance is conflict with the registered Instance,

func Remove

func Remove(ins *common.Instance)

Remove indicates this client deregister from Registry immediately.

Types

This section is empty.

Jump to

Keyboard shortcuts

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