etcdtest

package
v0.27.92 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0, MIT Imports: 13 Imported by: 0

Documentation

Overview

Package etcdtest implements test utilities to start a local etcd instance using testcontainers for testing purposes.

Index

Constants

This section is empty.

Variables

View Source
var (
	Urls []string
)

Functions

func DeleteAll

func DeleteAll() error

DeleteAll deletes the 'routes' directory from etcd with the prefix '/skippertest'.

func DeleteAllFrom

func DeleteAllFrom(prefix string) error

DeleteAllFrom deletes the 'routes' directory with the specified prefix.

func DeleteData

func DeleteData(key string) error

DeleteData deletes a route from etcd with the prefix '/skippertest'.

func DeleteDataFrom

func DeleteDataFrom(prefix, key string) error

DeleteDataFrom deletes a route from etcd with the specified prefix.

func GetNode

func GetNode(key string) (string, error)

GetNode loads an etcd route node from the prefix '/skippertest'.

func GetNodeFrom

func GetNodeFrom(prefix, key string) (string, error)

GetNodeFrom loads an etcd route node from the specified prefix.

func PutData

func PutData(key, data string) error

PutData saves a route in etcd with the prefix '/skippertest'.

func PutDataTo

func PutDataTo(prefix, key, data string) error

PutDataTo saves a route in etcd with the specified prefix.

func PutDataToTTL added in v0.16.78

func PutDataToTTL(prefix, key, data string, ttl int) error

PutDataToTTL saves a route with TTL in etcd with the specified prefix.

func ResetData

func ResetData() error

ResetData deletes all routes and creates a test route under '/skippertest'.

func ResetDataIn

func ResetDataIn(prefix string) error

ResetDataIn deletes all routes and creates a test route under the specified prefix.

func Start

func Start() error

Start starts an etcd testcontainer with v2 API enabled.

func StartProjectRoot added in v0.11.89

func StartProjectRoot(_ string) error

StartProjectRoot starts an etcd server. Deprecated: delegates to Start.

func Stop

func Stop() error

Stop terminates the running etcd container.

Types

This section is empty.

Jump to

Keyboard shortcuts

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