etcd

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

+kubebuilder:validation:Optional

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module() fx.Option

Module is a fx module that provides etcd client.

Types

type Client

type Client struct {
	// raw client
	Client *clientv3.Client
	// interfaces rooted by namespace -- use these for all operations instead of the raw client
	KV      clientv3.KV
	Watcher clientv3.Watcher
	Lease   clientv3.Lease
	LeaseID clientv3.LeaseID
}

Client is a wrapper around etcd client v3.

func ProvideClient

func ProvideClient(in ClientIn) (*Client, error)

ProvideClient creates a new Etcd Client and provides it via Fx.

type ClientIn

type ClientIn struct {
	fx.In

	Unmarshaller config.Unmarshaller
	Lifecycle    fx.Lifecycle
	Shutdowner   fx.Shutdowner
	Logger       *log.Logger
}

ClientIn holds parameters for ProvideClient.

type EtcdConfig

type EtcdConfig struct {
	// Lease time-to-live
	LeaseTTL config.Duration `json:"lease_ttl" validate:"gte=1s" default:"60s"`
	// List of Etcd server endpoints
	Endpoints []string `json:"endpoints" validate:"gt=0,dive,hostname_port|url|fqdn"`
	// Client TLS configuration
	ClientTLSConfig tlsconfig.ClientTLSConfig `json:"tls"`
	// Authentication
	Username string `json:"username"`
	Password string `json:"password"`
}

EtcdConfig holds configuration for etcd client. swagger:model +kubebuilder:object:generate=true

func (*EtcdConfig) DeepCopy added in v0.1.2

func (in *EtcdConfig) DeepCopy() *EtcdConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdConfig.

func (*EtcdConfig) DeepCopyInto added in v0.1.2

func (in *EtcdConfig) DeepCopyInto(out *EtcdConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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