driver

package
v0.0.0-...-5bb375e Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const GlobalKeyPrefix = "distributed-cron:"

Variables

This section is empty.

Functions

func RegisterDriver

func RegisterDriver(driverName string, driver Driver)

Types

type Driver

type Driver interface {
	Open(dataSourceOption DriverConnOpt)
	SetHeartBeat(nodeId string)
	SetTimeout(timeout time.Duration)
	GetNodeList(serverName string) []string
	RegisterNode(serverName string) string
}

func GetDriver

func GetDriver(driverName string) Driver

type DriverConnOpt

type DriverConnOpt struct {
	Host     string
	Port     string
	Password string
}

type RedisDriver

type RedisDriver struct {
	Key string
	// contains filtered or unexported fields
}

func (*RedisDriver) GetNodeList

func (this *RedisDriver) GetNodeList(serverName string) []string

func (*RedisDriver) Open

func (this *RedisDriver) Open(dataSourceOption DriverConnOpt)

func (*RedisDriver) RegisterNode

func (this *RedisDriver) RegisterNode(serverName string) (nodeId string)

func (*RedisDriver) SetHeartBeat

func (this *RedisDriver) SetHeartBeat(nodeId string)

func (*RedisDriver) SetTimeout

func (this *RedisDriver) SetTimeout(timeout time.Duration)

Jump to

Keyboard shortcuts

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