etcdtest

package
v0.53.2 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package etcdtest runs an in-process single-node etcd for tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(tb testing.TB) string

Start boots an etcd that stops with tb and returns its client endpoint URL.

Types

type Server

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

Server is an embedded etcd that can be stopped and restarted on the same client URL and data directory, which is what an etcd rollout looks like to a node that keeps running across it.

func NewServer

func NewServer(tb testing.TB) *Server

NewServer boots an etcd that stops with tb, on a client port the kernel picks.

func (*Server) Dial

func (s *Server) Dial() *clientv3.Client

Dial returns a client for this server, closed with the test.

func (*Server) Endpoint

func (s *Server) Endpoint() string

Endpoint returns the client URL, stable across Server.Restart.

func (*Server) Restart

func (s *Server) Restart()

Restart starts a stopped server again on its client URL and data directory. Rebinding a fixed port can collide with another socket; nothing reserves it while the server is down.

func (*Server) Stop

func (s *Server) Stop()

Stop shuts etcd down. It is a no-op on a stopped server.

Jump to

Keyboard shortcuts

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