etcd

package
v0.0.0-...-04b3ff8 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Call

func Call() *clientv3.Client

func KeyValueGet

func KeyValueGet(key string) (string, error)

func KeyValuePut

func KeyValuePut(key string, value string) error

func KeyValuePutWithTTL

func KeyValuePutWithTTL(key string, value string, ttl int64) error

func KeyValueWatch

func KeyValueWatch(ctx context.Context, key string) <-chan KvWatchRsq

func ServiceConnect

func ServiceConnect(endpoints []string) error

func ServiceDelete

func ServiceDelete(id InstanceID) error

func ServiceDisconnect

func ServiceDisconnect()

func ServiceLock

func ServiceLock(ctx context.Context, name string) error

func ServiceLockInit

func ServiceLockInit() error

func ServiceStatusUpdate

func ServiceStatusUpdate(id InstanceID, status int) error

func ServiceUnlock

func ServiceUnlock(ctx context.Context, name string) error

func ServiceWatch

func ServiceWatch(name string) <-chan SvcWatchRsq

func TimestampGet

func TimestampGet() string

func UUID

func UUID() string

Types

type Connect

type Connect struct {
	// contains filtered or unexported fields
}

type EVENT_TYPE

type EVENT_TYPE int
const (
	EVENT_ADD EVENT_TYPE
	EVENT_UPDATE
	EVENT_DELETE
	EVENT_EXPIRE
)

type Instance

type Instance struct {
	ID        InstanceID `json:"instanceid"`
	Timestamp string     `json:"timestamp"`
	Endpoints []string   `json:"endpoints"`
	Status    int        `json:"status"`
	// contains filtered or unexported fields
}

func ServiceQuery

func ServiceQuery(name string) ([]Instance, error)

type InstanceCtrl

type InstanceCtrl struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

type InstanceID

type InstanceID string

func NewInstanceID

func NewInstanceID() InstanceID

func ServcieRegister

func ServcieRegister(name string, endpoints []string) (InstanceID, error)

type KeyValue

type KeyValue struct {
	Key   string
	Value string
}

func KeyValueGetWithChild

func KeyValueGetWithChild(key string) ([]KeyValue, error)

type KvWatchRsq

type KvWatchRsq struct {
	Act   EVENT_TYPE
	Key   string
	Value string
}

type Service

type Service struct {
	Name      string `json:"servicename"`
	Timestamp string `json:"timestamp"`
}

type ServiceMap

type ServiceMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

type SvcWatchRsq

type SvcWatchRsq struct {
	Act  EVENT_TYPE
	Name string
	Inst Instance
}

Jump to

Keyboard shortcuts

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