etcd_defrag

package module
v0.0.0-...-35668af Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: MIT Imports: 5 Imported by: 0

README

etcd-defrag

An etcd data defragmentation tool for v3

Example

etcd defrag data by API

err := etcd_defrag.Run(
    []string{
        "https://127.0.0.1:4001",
    },
    "./certificate/service.cert",
    "./certificate/service.key",
    "./certificate/ca.cert",
)
if err != nil {
    fmt.Printf("clean failure: %s\n", err.Error())
}
fmt.Println("clean success")

defrag data by CMD

defrag -eps="http://127.0.0.1:4001, http://127.0.0.2:4001" --trusted-ca-file="ca.cert" --cert-file="service.cert" --key-file="service.key"

Documentation

Index

Constants

View Source
const (
	CertFile = iota
	KeyFile
	TrustedCAFile
	Padding
)

Variables

This section is empty.

Functions

func Run

func Run(endpoints []string, cert, key, trusted string) error

func RunWithoutCA

func RunWithoutCA(endpoints []string) error

Types

type CA

type CA struct {
	File    [Padding]string
	TLSInfo *transport.TLSInfo
}

func NewCA

func NewCA(cert, key, trusted string) *CA

func (*CA) GetConfig

func (r *CA) GetConfig() (*tls.Config, error)

type Defrag

type Defrag struct {
	*v3.Client

	Name      string
	Version   string
	Endpoints []string
}

func NewDefrag

func NewDefrag(ep []string, cfg *tls.Config) (*Defrag, error)

func (*Defrag) Clean

func (d *Defrag) Clean() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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