secrettest

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package secrettest provides a cross-process testable secret.Stash.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a client for a secret stash server. It is safe for concurrent use.

func NewClient

func NewClient(srvURL string) (*Client, error)

NewClient creates a new client capable of talking to a secret stash server.

The server URL should be the base URL of the server.

func (*Client) DeleteSecret

func (c *Client) DeleteSecret(service, key string) error

DeleteSecret deletes a secret from the stash.

func (*Client) LoadSecret

func (c *Client) LoadSecret(service, key string) (string, error)

LoadSecret loads a secret from the stash.

func (*Client) SaveSecret

func (c *Client) SaveSecret(service, key, secret string) error

SaveSecret saves a secret in the stash.

type Server

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

Server is a test server for secret.Stash.

func NewServer

func NewServer(t testing.TB) *Server

NewServer creates a new server for a secret stash. It will automatically shut down when the test ends.

func (*Server) URL

func (s *Server) URL() string

URL returns the URL at which the server is listening. Use Client to talk to this server.

Jump to

Keyboard shortcuts

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