Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) Close() error
- func (c *Client) Connect(ctx context.Context) error
- func (c *Client) Delete(ctx context.Context, name string) error
- func (c *Client) Get(ctx context.Context, name string) (string, error)
- func (c *Client) IsServerRunning(ctx context.Context) bool
- func (c *Client) Ping(ctx context.Context) error
- func (c *Client) Store(ctx context.Context, name, secret string, funcs ...options.StoreOptsFn) error
- type Option
- type ServerLauncher
Constants ¶
This section is empty.
Variables ¶
var ErrServerStartFailed = errors.New("server failed to start (and fallback mode is disabled)")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the burnafter client.
This is the library that applications use to spin up the embedded server used to store and retrieve secrets.
func (*Client) Connect ¶
Connect establishes the connection to the server. If the server is not running, this function spawns the forked process to start listening.
If NoServer option is set or server startup fails, fallback mode is used.
func (*Client) Delete ¶
Delete removes a secret from fallback encrypted file storage Note: Delete is only supported in fallback mode currently
func (*Client) IsServerRunning ¶
isServerRunning checks if the server is responding
type Option ¶ added in v0.2.0
type Option func(*Client)
Option configures a Client.
func WithServerLauncher ¶ added in v0.2.0
func WithServerLauncher(l ServerLauncher) Option
WithServerLauncher enables embedded-server mode by supplying the launcher (typically embedded.Launch). Without it, a client falls back to file or in-memory storage instead of spawning a server.
type ServerLauncher ¶ added in v0.2.0
ServerLauncher starts the burnafter server as a detached subprocess configured with the given options. The embedded-server implementation lives in the github.com/carabiner-dev/burnafter/embedded package (embedded.Launch); keeping it out of the core lets programs that only use the in-memory or encrypted-file modes avoid linking the multi-megabyte embedded server binary.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
burnafter
command
|
|
|
burnafter-server
command
Package main provides a minimal server-only entry point for the burnafter dæmon.
|
Package main provides a minimal server-only entry point for the burnafter dæmon. |
|
Package embedded provides the embedded burnafter server and the launcher that starts it.
|
Package embedded provides the embedded burnafter server and the launcher that starts it. |
|
hack
|
|
|
gzip
command
Command gzip compresses a file to <file>.gz using Go's compress/gzip and then removes the original, mimicking `gzip -f`.
|
Command gzip compresses a file to <file>.gz using Go's compress/gzip and then removes the original, mimicking `gzip -f`. |
|
internal
|
|
|
Package secrets exposes the public interface for secret storage implementations the most basic of these is the memory driver that burnafter uses when it cannot access more secure system managed storage.
|
Package secrets exposes the public interface for secret storage implementations the most basic of these is the memory driver that burnafter uses when it cannot access more secure system managed storage. |