api

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 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 API

type API interface {
	// Write sends data to the Vault API.
	Write(ctx context.Context, path string, vaultToken string, payload interface{}) (*Response, error)

	// Read retrieves data from the Vault API.
	Read(ctx context.Context, path string, vaultToken string) (*Response, error)
}

API executes actions against the Vault API manually.

This is primarily used by the various vaultx clients to communicate with Vault but can also be used by consumers for functionality not yet implemented by the package.

type Client

type Client struct {
	HTTP *http.Client
	URL  string
}

Client executes actions against the Vault API manually.

This is primarily used by the various vaultx clients to communicate with Vault but can also be used by consumers for functionality not yet implemented by the package.

func (*Client) Read

func (c *Client) Read(ctx context.Context, path string, vaultToken string) (*Response, error)

func (*Client) Write

func (c *Client) Write(ctx context.Context, path string, vaultToken string, payload interface{}) (*Response, error)

type Response

type Response struct {
	StatusCode int
	RawBody    io.ReadCloser
}

func (*Response) JSON

func (r *Response) JSON(v interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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