metarepos

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

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

Node represents a metadata repository node.

func New

func New(t *testing.T, opts ...Option) *Node

New creates a new metadata repository node.

func (*Node) RPCAddress

func (node *Node) RPCAddress() string

RPCAddress returns an address for RPC communication.

func (*Node) RaftURL

func (node *Node) RaftURL() string

RaftURL returns an URL for Raft.

func (*Node) ResetPeers

func (node *Node) ResetPeers(peers []string)

ResetPeers updates peer nodes for Raft.

func (*Node) Running

func (node *Node) Running() bool

Running returns true if a metadata repository is running.

func (*Node) Start

func (node *Node) Start(t *testing.T)

Start runs a metadata repository node.

func (*Node) Stop

func (node *Node) Stop(t *testing.T)

Stop terminates a metadata repository node.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option configures a Node for metadata repository.

func WithClusterID

func WithClusterID(cid types.ClusterID) Option

WithClusterID sets a cluster ID.

func WithExecutable

func WithExecutable(executable string) Option

WithExecutable sets an executable for the metadata repository.

func WithLogDir

func WithLogDir(logDir string) Option

WithLogDir sets a directory for logs.

func WithLogger

func WithLogger(logger *zap.Logger) Option

WithLogger sets a logger.

func WithNodeName

func WithNodeName(name string) Option

WithNodeName sets a node name. Users should select a unique name.

func WithPeers

func WithPeers(peers []string) Option

WithPeers sets peer nodes for Raft.

func WithRPCAddr

func WithRPCAddr(rpcAddr string) Option

WithRPCAddr sets an address for RPC communication.

func WithRaftDir

func WithRaftDir(raftDir string) Option

WithRaftDir sets a directory for the Raft data.

func WithRaftURL

func WithRaftURL(raftURL string) Option

WithRaftURL sets an URL for Raft.

func WithReplicationFactor

func WithReplicationFactor(replicationFactor int) Option

WithReplicationFactor sets replication factor.

Jump to

Keyboard shortcuts

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