etcd

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: MIT Imports: 20 Imported by: 0

README

POSH etcd provider

Usage

Configuration

etcd:
  configPath: .posh/config/etcd
  clusters:
    - name: prod
      podName: etcd-0
      namespace: etcd
      paths: [ "cluster-prod.yaml" ]
    - name: stage
      podName: etcd-0
      namespace: etcd
      paths: [ "cluster-stage.yaml" ]

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	Name      string   `json:"name" yaml:"name"`
	PodName   string   `json:"podName" yaml:"podName"`
	Namespace string   `json:"namespace" yaml:"namespace"`
	Paths     []string `json:"paths" yaml:"paths"`
}

type Command

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

func NewCommand

func NewCommand(l log.Logger, etcd *ETCD, kubectl *kubectl.Kubectl, opts ...Option) *Command

func (*Command) Complete

func (c *Command) Complete(ctx context.Context, r *readline.Readline) []goprompt.Suggest

func (*Command) Description

func (c *Command) Description() string

func (*Command) Execute

func (c *Command) Execute(ctx context.Context, r *readline.Readline) error

func (*Command) Help

func (c *Command) Help(ctx context.Context, r *readline.Readline) string

func (*Command) Name

func (c *Command) Name() string

type Config

type Config struct {
	ConfigPath string    `json:"configPath" yaml:"configPath"`
	Clusters   []Cluster `json:"clusters" yaml:"clusters"`
}

func (Config) Cluster

func (c Config) Cluster(name string) (Cluster, bool)

type ETCD

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

func New

func New(l log.Logger, kubectl *kubectl.Kubectl, opts ...Option) (*ETCD, error)

func (*ETCD) GetPath

func (c *ETCD) GetPath(ctx context.Context, cluster Cluster, profile, path string) (string, error)

func (*ETCD) SetPath

func (c *ETCD) SetPath(ctx context.Context, cluster Cluster, profile, path, value string) (string, error)

type Option

type Option func(*ETCD) error

func CommandWithConfigKey

func CommandWithConfigKey(v string) Option

Jump to

Keyboard shortcuts

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