client

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Vault      *api.Client
	Name       string
	Pwd        string
	KVBackends map[string]int
}

Client wrapper for Vault API client

func NewClient

func NewClient(conf *VaultConfig) (*Client, error)

NewClient creates a new Client Vault wrapper

func (*Client) Delete

func (client *Client) Delete(absolutePath string) (err error)

Delete deletes secret at given absolutePath, using given client

func (*Client) GetType

func (client *Client) GetType(absolutePath string) (kind PathKind)

GetType returns the file type the given absolutePath points to. Possible return values are BACKEND, NODE, LEAF or NONE

func (*Client) List

func (client *Client) List(absolutePath string) (result []string, err error)

List elements at the given absolutePath, using the given client

func (*Client) Read

func (client *Client) Read(absolutePath string) (secret *api.Secret, err error)

Read returns secret at given path, using given Client

func (*Client) Traverse

func (client *Client) Traverse(absolutePath string) (paths []string)

Traverse traverses given absolutePath via DFS and returns sub-paths in array

func (*Client) Write

func (client *Client) Write(absolutePath string, secret *api.Secret) (err error)

Write writes secret to given path, using given Client

type PathKind

type PathKind int

PathKind describes the type of a path

const (
	BACKEND PathKind = iota
	NODE
	LEAF
	NONE
)

types of paths

type VaultConfig

type VaultConfig struct {
	Addr      string
	Token     string
	StartPath string
}

VaultConfig container to keep parameters for Client configuration

Jump to

Keyboard shortcuts

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