Documentation ¶
Index ¶
- Constants
- func GetConsulLogPath(api *APIClient) (string, error)
- func GetNomadLogPath(api *APIClient) (string, error)
- func GetVaultAuditLogPath(api *APIClient) (string, error)
- type APIClient
- func (c *APIClient) Get(path string) (interface{}, error)
- func (c *APIClient) GetStringValue(path string, mapKeys ...string) (string, error)
- func (c *APIClient) GetValue(path string, mapKeys ...string) (interface{}, error)
- func (c *APIClient) RedactGet(path string, redactions []*redact.Redact) (any, error)
- type APIConfig
- type APIResponse
- type HTTPClient
- type TLSConfig
Constants ¶
const ( DefaultConsulAddr = "http://127.0.0.1:8500" EnvConsulCaCert = "CONSUL_CACERT" EnvConsulCaPath = "CONSUL_CAPATH" EnvConsulClientCert = "CONSUL_CLIENT_CERT" EnvConsulClientKey = "CONSUL_CLIENT_KEY" EnvConsulHttpSslVerify = "CONSUL_HTTP_SSL_VERIFY" EnvConsulTlsServerName = "CONSUL_TLS_SERVER_NAME" )
const ( DefaultNomadAddr = "http://127.0.0.1:4646" EnvNomadCaCert = "NOMAD_CACERT" EnvNomadCaPath = "NOMAD_CAPATH" EnvNomadClientCert = "NOMAD_CLIENT_CERT" EnvNomadClientKey = "NOMAD_CLIENT_KEY" EnvNomadSkipVerify = "NOMAD_SKIP_VERIFY" EnvNomadTlsServerName = "NOMAD_TLS_SERVER_NAME" )
const ( DefaultVaultAddr = "http://127.0.0.1:8200" EnvVaultCaCert = "VAULT_CACERT" EnvVaultCaPath = "VAULT_CAPATH" EnvVaultClientCert = "VAULT_CLIENT_CERT" EnvVaultClientKey = "VAULT_CLIENT_KEY" EnvVaultSkipVerify = "VAULT_SKIP_VERIFY" EnvVaultTlsServerName = "VAULT_TLS_SERVER_NAME" )
const DefaultTFEAddr = "https://127.0.0.1"
Variables ¶
This section is empty.
Functions ¶
func GetConsulLogPath ¶
func GetNomadLogPath ¶
func GetVaultAuditLogPath ¶
Types ¶
type APIClient ¶
type APIClient struct { APIConfig // contains filtered or unexported fields }
APIClient can make API calls.
func NewAPIClient ¶
NewAPIClient gets an API client for a product.
func NewConsulAPI ¶
NewConsulAPI returns an APIClient for Consul.
func NewNomadAPI ¶
NewNomadAPI returns an APIClient for Nomad.
func NewVaultAPI ¶
NewVaultAPI returns an APIClient for Vault.
func (*APIClient) GetStringValue ¶
GetStringValue runs GetValue() then casts the result to a string.
type APIConfig ¶ added in v0.3.0
type APIConfig struct { Product string `json:"product"` BaseURL string `json:"baseurl"` TLSConfig TLSConfig `json:"-"` // contains filtered or unexported fields }
APIConfig contains the configuration details for an APIClient.
type APIResponse ¶
type APIResponse struct {
Errors []string `json:"errors"`
}
type TLSConfig ¶ added in v0.3.0
type TLSConfig struct { // CACert is the path to a PEM-encoded CA cert file to use to verify the // server SSL certificate. It takes precedence over CACertBytes // and CAPath. CACert string // CACertBytes is a PEM-encoded certificate or bundle. It takes precedence // over CAPath. CACertBytes []byte // CAPath is the path to a directory of PEM-encoded CA cert files to verify // the server SSL certificate. CAPath string // ClientCert is the path to the certificate for communication ClientCert string // ClientKey is the path to the private key for communication ClientKey string // TLSServerName, if set, is used to set the SNI host when connecting via // TLS. TLSServerName string // Insecure enables or disables SSL verification. Setting to `true` is highly // discouraged. Insecure bool }
TLSConfig contains the parameters needed to configure TLS on the HTTP client used to communicate with an API.
func NewConsulTLSConfig ¶ added in v0.3.0
NewConsulTLSConfig returns a TLSConfig object, using default environment variables to build up the object.
func NewNomadTLSConfig ¶ added in v0.3.0
NewNomadTLSConfig returns a TLSConfig object, using default environment variables to build up the object.
func NewVaultTLSConfig ¶ added in v0.3.0
NewVaultTLSConfig returns a TLSConfig object, using default environment variables to build up the object.