internal

package
v0.0.0-...-838d9ca Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RenewSessionTime      = "5s"
	NotLeaderPoolInterval = 1
	LeaderPoolInterval    = 3
)

Variables

View Source
var OsExit = os.Exit

Functions

func ForWaitLeadership

func ForWaitLeadership(client Clienter, kvRetriever KvRetriever, p *consul.KVPair, isLeader chan bool, h string)

func ListenShutdown

func ListenShutdown(c Clienter, kvRetriever KvRetriever, sig chan os.Signal, isLeader chan bool, p *consul.KVPair)

func RenewSession

func RenewSession(client Clienter, sessionID string, doneChan chan struct{})

func WaitLeadership

func WaitLeadership(client Clienter, kvRetriever KvRetriever, p *consul.KVPair, isLeader chan bool, h string)

Types

type Clienter

type Clienter interface {
	Agent() *consul.Agent
	Session() *consul.Session
	KV() *consul.KV
}

type KeyValuer

type KeyValuer interface {
	Acquire(p *consul.KVPair, q *consul.WriteOptions) (bool, *consul.WriteMeta, error)
	Release(p *consul.KVPair, q *consul.WriteOptions) (bool, *consul.WriteMeta, error)
}

func KvFromClient

func KvFromClient(c Clienter) KeyValuer

type KvRetriever

type KvRetriever func(c Clienter) KeyValuer

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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