pulsar

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InvalidPort           = -1
	DefaultZKPort         = 2181
	DefaultBookiePort     = 3181
	DefaultBrokerPort     = 6650
	DefaultBrokerHTTPPort = 8080

	LatestImage = "apachepulsar/pulsar:latest"
)

Functions

func DefaultPulsarCluster

func DefaultPulsarCluster() (test.Cluster, error)

DefaultPulsarCluster creates a pulsar cluster using the default cluster spec.

func InitCluster

func InitCluster(conf *InitConf, image, network string) *test.BaseContainer

InitCluster returns a container for executing init pulsar cluster.

func NewPulsarCluster

func NewPulsarCluster(spec *ClusterSpec) (test.Cluster, error)

NewPulsarCluster creates a pulsar cluster using the spec.

func NewStandalone

func NewStandalone(image string) *test.BaseContainer

Types

type Cluster

type Cluster interface {
	// Start a pulsar cluster.
	Start(ctx context.Context) error

	// Stop a pulsar cluster.
	Stop(ctx context.Context) error

	// GetPlainTextServiceURL gets the pulsar service connect string.
	GetPlainTextServiceURL(ctx context.Context) (string, error)

	// GetHTTPServiceURL gets the pulsar HTTP service connect string.
	GetHTTPServiceURL(ctx context.Context) (string, error)

	// Close closes resources used for starting the cluster.
	Close(ctx context.Context)
}

type ClusterDef

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

func (*ClusterDef) Close

func (c *ClusterDef) Close(ctx context.Context)

func (*ClusterDef) GetHTTPServiceURL

func (c *ClusterDef) GetHTTPServiceURL(ctx context.Context) (string, error)

func (*ClusterDef) GetPlainTextServiceURL

func (c *ClusterDef) GetPlainTextServiceURL(ctx context.Context) (string, error)

func (*ClusterDef) Start

func (c *ClusterDef) Start(ctx context.Context) error

func (*ClusterDef) Stop

func (c *ClusterDef) Stop(ctx context.Context) error

type ClusterSpec

type ClusterSpec struct {
	Image                 string
	ClusterName           string
	BookiePort            int
	NumBookies            int
	BrokerServicePort     int
	BrokerHTTPServicePort int
	NumBrokers            int
	ProxyServicePort      int
	ProxyHTTPServicePort  int
	NumProxies            int
}

ClusterSpec is to build a pulsar cluster.

func DefaultClusterSpec

func DefaultClusterSpec() *ClusterSpec

DefaultClusterSpec returns default configuration of a cluster.

type InitConf

type InitConf struct {
	ClusterName        string
	ConfigurationStore string
	Zookeeper          string
	Broker             string
}

InitConf is a configuration for the initialization of the pulsar cluster.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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