testing

package
v0.0.0-...-10905f8 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2016 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HaveZnode

func HaveZnode(path string) OmegaMatcher

func HaveZnodeData

func HaveZnodeData(path string, data []byte) OmegaMatcher

func MatchEvent

func MatchEvent(eventType zk.EventType, eventState zk.State) OmegaMatcher

func ZkCollectEvents

func ZkCollectEvents(count int, evntChn <-chan zk.Event) []zk.Event

Collects go-zookeeper events.

func ZkConnect

func ZkConnect(zkHosts []string, zkSessionTimeout time.Duration, zkWaitForSessionTimeout time.Duration) (client *Client)

Create client connection to zk with timeout.

func ZkCreatePaths

func ZkCreatePaths(client *Client, paths ...string)

Create paths (without children) in zk.

func ZkDeletePaths

func ZkDeletePaths(client *Client, paths ...string)

Delete paths (without children) in zk.

func ZkUniqueNodeName

func ZkUniqueNodeName() string

Generates a unique string suitable for using as a node name.

Types

type EventMatcher

type EventMatcher struct {
	Type  zk.EventType
	State zk.State
}

Custom gomega matcher: zk event is the expected type with the expected state.

func (*EventMatcher) FailureMessage

func (matcher *EventMatcher) FailureMessage(actual interface{}) (message string)

func (*EventMatcher) Match

func (matcher *EventMatcher) Match(actual interface{}) (success bool, err error)

func (*EventMatcher) NegatedFailureMessage

func (matcher *EventMatcher) NegatedFailureMessage(actual interface{}) (message string)

type HaveZnodeDataMatcher

type HaveZnodeDataMatcher struct {
	Path string
	Data []byte
}

Custom gomega matcher: validates zk node data.

func (*HaveZnodeDataMatcher) FailureMessage

func (matcher *HaveZnodeDataMatcher) FailureMessage(actual interface{}) (message string)

func (*HaveZnodeDataMatcher) Match

func (matcher *HaveZnodeDataMatcher) Match(actual interface{}) (success bool, err error)

func (*HaveZnodeDataMatcher) NegatedFailureMessage

func (matcher *HaveZnodeDataMatcher) NegatedFailureMessage(actual interface{}) (message string)

type HaveZnodeMatcher

type HaveZnodeMatcher struct {
	Path string
}

Custom gomega matcher: validates zk node exists.

func (*HaveZnodeMatcher) FailureMessage

func (matcher *HaveZnodeMatcher) FailureMessage(actual interface{}) (message string)

func (*HaveZnodeMatcher) Match

func (matcher *HaveZnodeMatcher) Match(actual interface{}) (success bool, err error)

func (*HaveZnodeMatcher) NegatedFailureMessage

func (matcher *HaveZnodeMatcher) NegatedFailureMessage(actual interface{}) (message string)

Jump to

Keyboard shortcuts

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