Documentation ¶
Index ¶
- Constants
- func NewReplicationSetDocker(t *testing.T, opts *DockerClusterOptions) (*testcluster.ReplicationSet, error)
- type CertificateGetter
- type DockerCluster
- func (dc *DockerCluster) AddNode(ctx context.Context, opts *DockerClusterOptions) error
- func (dc *DockerCluster) Cleanup()
- func (dc *DockerCluster) ClusterID() string
- func (dc *DockerCluster) GetBarrierKeys() [][]byte
- func (dc *DockerCluster) GetBarrierOrRecoveryKeys() [][]byte
- func (dc *DockerCluster) GetCACertPEMFile() string
- func (dc *DockerCluster) GetRecoveryKeys() [][]byte
- func (dc *DockerCluster) GetRootToken() string
- func (dc *DockerCluster) NamedLogger(s string) log.Logger
- func (dc *DockerCluster) Nodes() []testcluster.VaultClusterNode
- func (dc *DockerCluster) SetBarrierKeys(keys [][]byte)
- func (dc *DockerCluster) SetRecoveryKeys(keys [][]byte)
- func (dc *DockerCluster) SetRootToken(s string)
- type DockerClusterNode
- func (n *DockerClusterNode) APIClient() *api.Client
- func (n *DockerClusterNode) APIClientN(listenerNumber int) (*api.Client, error)
- func (n *DockerClusterNode) AddNetworkDelay(ctx context.Context, delay time.Duration, targetIP string) error
- func (n *DockerClusterNode) Cleanup()
- func (n *DockerClusterNode) Name() string
- func (n *DockerClusterNode) Pause(ctx context.Context) error
- func (n *DockerClusterNode) Start(ctx context.Context, opts *DockerClusterOptions) error
- func (n *DockerClusterNode) Stop()
- func (n *DockerClusterNode) TLSConfig() *tls.Config
- type DockerClusterOptions
- type LogConsumerWriter
- type ReloadFunc
Constants ¶
View Source
const DefaultNumCores = 3
View Source
const MaxClusterNameLength = 52
Variables ¶
This section is empty.
Functions ¶
func NewReplicationSetDocker ¶
func NewReplicationSetDocker(t *testing.T, opts *DockerClusterOptions) (*testcluster.ReplicationSet, error)
Types ¶
type CertificateGetter ¶
CertificateGetter satisfies ReloadFunc and its GetCertificate method satisfies the tls.GetCertificate function signature. Currently it does not allow changing paths after the fact.
func NewCertificateGetter ¶
func NewCertificateGetter(certFile, keyFile, passphrase string) *CertificateGetter
func (*CertificateGetter) GetCertificate ¶
func (cg *CertificateGetter) GetCertificate(clientHello *tls.ClientHelloInfo) (*tls.Certificate, error)
func (*CertificateGetter) Reload ¶
func (cg *CertificateGetter) Reload() error
type DockerCluster ¶
type DockerCluster struct { ClusterName string RaftStorage bool ClusterNodes []*DockerClusterNode // Certificate fields *testcluster.CA RootCAs *x509.CertPool DockerAPI *docker.Client ID string Logger log.Logger // contains filtered or unexported fields }
DockerCluster is used to managing the lifecycle of the test Vault cluster
func NewDockerCluster ¶
func NewDockerCluster(ctx context.Context, opts *DockerClusterOptions) (*DockerCluster, error)
func NewTestDockerCluster ¶
func NewTestDockerCluster(t *testing.T, opts *DockerClusterOptions) *DockerCluster
func (*DockerCluster) AddNode ¶
func (dc *DockerCluster) AddNode(ctx context.Context, opts *DockerClusterOptions) error
func (*DockerCluster) Cleanup ¶
func (dc *DockerCluster) Cleanup()
func (*DockerCluster) ClusterID ¶
func (dc *DockerCluster) ClusterID() string
func (*DockerCluster) GetBarrierKeys ¶
func (dc *DockerCluster) GetBarrierKeys() [][]byte
func (*DockerCluster) GetBarrierOrRecoveryKeys ¶
func (dc *DockerCluster) GetBarrierOrRecoveryKeys() [][]byte
func (*DockerCluster) GetCACertPEMFile ¶
func (dc *DockerCluster) GetCACertPEMFile() string
func (*DockerCluster) GetRecoveryKeys ¶
func (dc *DockerCluster) GetRecoveryKeys() [][]byte
func (*DockerCluster) GetRootToken ¶
func (dc *DockerCluster) GetRootToken() string
GetRootToken returns the root token of the cluster, if set
func (*DockerCluster) NamedLogger ¶
func (dc *DockerCluster) NamedLogger(s string) log.Logger
func (*DockerCluster) Nodes ¶
func (dc *DockerCluster) Nodes() []testcluster.VaultClusterNode
func (*DockerCluster) SetBarrierKeys ¶
func (dc *DockerCluster) SetBarrierKeys(keys [][]byte)
func (*DockerCluster) SetRecoveryKeys ¶
func (dc *DockerCluster) SetRecoveryKeys(keys [][]byte)
func (*DockerCluster) SetRootToken ¶
func (dc *DockerCluster) SetRootToken(s string)
type DockerClusterNode ¶
type DockerClusterNode struct { NodeID string HostPort string ServerCert *x509.Certificate ServerCertBytes []byte ServerCertPEM []byte ServerCertPEMFile string ServerKey *ecdsa.PrivateKey ServerKeyPEM []byte ServerKeyPEMFile string WorkDir string Cluster *DockerCluster Container *types.ContainerJSON DockerAPI *docker.Client Logger log.Logger RealAPIAddr string ContainerNetworkName string ContainerIPAddress string ImageRepo string ImageTag string DataVolumeName string AllClients []*api.Client // contains filtered or unexported fields }
DockerClusterNode represents a single instance of Vault in a cluster
func (*DockerClusterNode) APIClient ¶
func (n *DockerClusterNode) APIClient() *api.Client
func (*DockerClusterNode) APIClientN ¶ added in v0.10.0
func (n *DockerClusterNode) APIClientN(listenerNumber int) (*api.Client, error)
func (*DockerClusterNode) AddNetworkDelay ¶
func (*DockerClusterNode) Cleanup ¶
func (n *DockerClusterNode) Cleanup()
Cleanup kills the container of the node and deletes its data volume
func (*DockerClusterNode) Name ¶
func (n *DockerClusterNode) Name() string
func (*DockerClusterNode) Start ¶
func (n *DockerClusterNode) Start(ctx context.Context, opts *DockerClusterOptions) error
func (*DockerClusterNode) Stop ¶
func (n *DockerClusterNode) Stop()
Stop kills the container of the node
func (*DockerClusterNode) TLSConfig ¶
func (n *DockerClusterNode) TLSConfig() *tls.Config
type DockerClusterOptions ¶
type DockerClusterOptions struct { testcluster.ClusterOptions CAKey *ecdsa.PrivateKey NetworkName string ImageRepo string ImageTag string CA *testcluster.CA VaultBinary string Args []string StartProbe func(*api.Client) error }
DockerClusterOptions has options for setting up the docker cluster
func DefaultOptions ¶
func DefaultOptions(t *testing.T) *DockerClusterOptions
type LogConsumerWriter ¶
type LogConsumerWriter struct {
// contains filtered or unexported fields
}
type ReloadFunc ¶
type ReloadFunc func() error
ReloadFunc are functions that are called when a reload is requested
Click to show internal directories.
Click to hide internal directories.