reaper

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CassandraClusterNotFound = errors.New("cassandra cluster not found")

	ErrRedirectsNotSupported = errors.New("http redirects are not supported")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	BaseURL   *url.URL
	UserAgent string
	// contains filtered or unexported fields
}

func (*Client) AddCluster

func (c *Client) AddCluster(ctx context.Context, cluster string, seed string) error

func (*Client) DeleteCluster

func (c *Client) DeleteCluster(ctx context.Context, cluster string) error

func (*Client) GetCluster

func (c *Client) GetCluster(ctx context.Context, name string) (*Cluster, error)

func (*Client) GetClusterNames

func (c *Client) GetClusterNames(ctx context.Context) ([]string, error)

func (*Client) GetClusters

func (c *Client) GetClusters(ctx context.Context) <-chan GetClusterResult

Fetches all clusters. This function is async and may return before any or all results are available. The concurrency is currently determined by min(5, NUM_CPUS).

func (*Client) GetClustersSync

func (c *Client) GetClustersSync(ctx context.Context) ([]*Cluster, error)

Fetches all clusters in a synchronous or blocking manner. Note that this function fails fast if there is an error and no clusters will be returned.

func (*Client) IsReaperUp

func (c *Client) IsReaperUp(ctx context.Context) (bool, error)

type Cluster

type Cluster struct {
	Name           string
	JmxUsername    string
	JmxPasswordSet bool
	Seeds          []string
	NodeState      NodeState
}

type DataCenterState

type DataCenterState struct {
	Name  string
	Racks map[string]RackState
}

type EndpointState

type EndpointState struct {
	Endpoint       string
	DataCenter     string
	Rack           string
	HostId         string
	Status         string
	Severity       float64
	ReleaseVersion string
	Tokens         string
	Load           float64
}

type GetClusterResult

type GetClusterResult struct {
	Cluster *Cluster
	Error   error
}

type GossipState

type GossipState struct {
	SourceNode    string
	EndpointNames []string
	TotalLoad     float64
	DataCenters   map[string]DataCenterState
}

type NodeState

type NodeState struct {
	GossipStates []GossipState
}

type RackState

type RackState struct {
	Name      string
	Endpoints []EndpointState
}

type ReaperClient

type ReaperClient interface {
	IsReaperUp(ctx context.Context) (bool, error)

	GetClusterNames(ctx context.Context) ([]string, error)

	GetCluster(ctx context.Context, name string) (*Cluster, error)

	// Fetches all clusters. This function is async and may return before any or all results are
	// available. The concurrency is currently determined by min(5, NUM_CPUS).
	GetClusters(ctx context.Context) <-chan GetClusterResult

	// Fetches all clusters in a synchronous or blocking manner. Note that this function fails
	// fast if there is an error and no clusters will be returned.
	GetClustersSync(ctx context.Context) ([]*Cluster, error)

	AddCluster(ctx context.Context, cluster string, seed string) error

	DeleteCluster(ctx context.Context, cluster string) error
}

func NewReaperClient

func NewReaperClient(baseURL string) (ReaperClient, error)

Jump to

Keyboard shortcuts

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