package
0.0.0-20240701071450-45e2431495c8
Repository: https://github.com/docker/go-plugins-helpers.git
Documentation: pkg.go.dev
# README
Docker secrets extension API
Go handler to get secrets from external secret stores in Docker.
Usage
This library is designed to be integrated in your program.
- Implement the
secrets.Driver
interface. - Initialize a
secrets.Handler
with your implementation. - Call either
ServeTCP
orServeUnix
from thesecrets.Handler
.
Example using TCP sockets:
import "github.com/docker/go-plugins-helpers/secrets"
d := MySecretsDriver{}
h := secrets.NewHandler(d)
h.ServeTCP("test_secrets", ":8080")
Example using Unix sockets:
import "github.com/docker/go-plugins-helpers/secrets"
d := MySecretsDriver{}
h := secrets.NewHandler(d)
h.ServeUnix("test_secrets", 0)
# Functions
NewHandler initializes the request handler with a driver implementation.
# Structs
EndpointSpec represents the spec of an endpoint.
Handler forwards requests and responses between the docker daemon and the plugin.
PortConfig represents the config of a port.
Request is the plugin secret request.
Response contains the plugin secret value.
# Interfaces
Driver represent the interface a driver must fulfill.