zookclient

package module
v0.0.0-...-96e0ba9 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: Apache-2.0 Imports: 8 Imported by: 2

README

A simple Zookeeper-client for Go

Hopefully this project helps to make use of Zookeeper for Go-projects. The purpose is to make use of Zookeeper without struggling with the lower level API for Zookeeper.

Disclaimer

This library is still under construction and all methods (or functions) are not tested thoroughly.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LiveNodeInfo

type LiveNodeInfo struct {
	Name      string    `json:"name"`
	StartTime time.Time `json:"startTime"`
	Host      string    `json:"host"`
	JMXPort   int       `json:"jmxPort"`
	StatusURL string    `json:"statusUrl"`
}

type NodeInfo

type NodeInfo struct {
	Name          string            `json:"name"`
	Properties    map[string]string `json:"properties"`
	Type          ServiceType       `json:"type"`
	LastStartTime time.Time         `json:"lastStartTime"`
	LastExitTime  time.Time         `json:"lastExitTime"`
}

type PersistentNode

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

func NewPersistentNode

func NewPersistentNode(client curator.CuratorFramework, mode curator.CreateMode, protection bool, basePath string, initData []byte) *PersistentNode

func (*PersistentNode) ActualPath

func (p *PersistentNode) ActualPath() string

func (*PersistentNode) Close

func (p *PersistentNode) Close() error

func (*PersistentNode) GetData

func (p *PersistentNode) GetData() []byte

func (*PersistentNode) IsAuthFailure

func (p *PersistentNode) IsAuthFailure() bool

func (*PersistentNode) SetData

func (p *PersistentNode) SetData(d []byte) error

func (*PersistentNode) Start

func (p *PersistentNode) Start() error

type ServiceType

type ServiceType int8
const (
	CORE ServiceType = iota
	ADAPTER
	LIVE_ADAPTER
)

type StateType

type StateType int
const (
	Latent StateType = iota
	Started
	Closed
)

type ZooKeeperClient

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

func NewZooKeeperClient

func NewZooKeeperClient(connStr string) (*ZooKeeperClient, error)

func (*ZooKeeperClient) Close

func (z *ZooKeeperClient) Close() error

func (*ZooKeeperClient) CreateEphemeralNode

func (z *ZooKeeperClient) CreateEphemeralNode(path string, data []byte) error

func (*ZooKeeperClient) CreateNode

func (z *ZooKeeperClient) CreateNode(path string, data []byte) error

func (*ZooKeeperClient) CreatePath

func (z *ZooKeeperClient) CreatePath(path string) error

func (*ZooKeeperClient) CreatePersistentNode

func (z *ZooKeeperClient) CreatePersistentNode(path string, obj interface{}) (interface{}, error)

func (*ZooKeeperClient) Delete

func (z *ZooKeeperClient) Delete(path string, delChildren bool) error

func (*ZooKeeperClient) Exists

func (z *ZooKeeperClient) Exists(path string) bool

func (*ZooKeeperClient) GetChildren

func (z *ZooKeeperClient) GetChildren(root string) ([]string, error)

GetChildren return all leaf-node paths under root

func (*ZooKeeperClient) GetData

func (z *ZooKeeperClient) GetData(path string) ([]byte, error)

func (*ZooKeeperClient) GetNode

func (z *ZooKeeperClient) GetNode(path string) (interface{}, error)

func (*ZooKeeperClient) GetNodes

func (z *ZooKeeperClient) GetNodes(path string) ([]interface{}, error)

func (*ZooKeeperClient) GetStringData

func (z *ZooKeeperClient) GetStringData(path string) (string, error)

func (*ZooKeeperClient) SetByte

func (z *ZooKeeperClient) SetByte(path string, b []byte) error

func (*ZooKeeperClient) SetData

func (z *ZooKeeperClient) SetData(path string, data []byte, mode curator.CreateMode) error

func (*ZooKeeperClient) SetObject

func (z *ZooKeeperClient) SetObject(path string, obj interface{}) error

Jump to

Keyboard shortcuts

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