zookeeper

package
v4.0.9+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Path

func Path(path string) string

Path takes a zookeeper path and prepends it with argument args.GlobalArgs

Types

type Connection

type Connection interface {
	Get(string) ([]byte, *zk.Stat, error)
	Children(string) ([]string, *zk.Stat, error)
}

Connection interface to allow easy mocking of a Zookeeper connection

func NewConnection

func NewConnection(kafkaArgs *args.ParsedArguments) (Connection, error)

NewConnection creates a new Connection with the given arguments. If not hosts are specified then a nil Connection and error will be returned

Waiting on issue https://github.com/samuel/go-zookeeper/issues/108 so we can change this function and allow us to mock out the zk.Connect function

type MockConnection

type MockConnection struct {
	mock.Mock
}

MockConnection implements Connection to facilitate testing.

func (*MockConnection) Children

func (m *MockConnection) Children(s string) ([]string, *zk.Stat, error)

Children mocks the Children method

func (*MockConnection) Get

func (m *MockConnection) Get(s string) ([]byte, *zk.Stat, error)

Get mocks the Get method

Jump to

Keyboard shortcuts

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