doppler

package module
v0.0.1-dev Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	EnvFormat                  Format = "env"
	EnvNoQuotesFormat          Format = "env-no-quote"
	JSONFormat                 Format = "json"
	DotNETJSONFormat           Format = "dotnet-json"
	JavaSpringPropertiesFormat Format = "java-spring-properties"
	YAMLFormat                 Format = "yaml"

	CamelNameTransformer      NameTransformer = "camel"
	UpperCamelNameTransformer NameTransformer = "upper-camel"
	LowerSnakeNameTransformer NameTransformer = "lower-snake"
	TFVarNameTransformer      NameTransformer = "tf-var"
	DotNETEnvNameTransformer  NameTransformer = "dotnet-env"
)

Variables

Functions

func GetRequest

func GetRequest(client *APIClient, path string, headers Headers, params QueryParams) (*APIResponse, *APIClientError)

func NewAPIClient

func NewAPIClient(dopplerToken string) (*APIClient, *APIClientError)

func PerformRequest

func PerformRequest(client *APIClient, req *http.Request) (*APIResponse, *APIClientError)

func ValidToken

func ValidToken(token string) error

func ValidateFormat

func ValidateFormat(format Format) error

func ValidateNameTransformer

func ValidateNameTransformer(nameTransformer NameTransformer) error

Types

type APIClient

type APIClient struct {
	VerifyTLS bool
	UserAgent string
	// contains filtered or unexported fields
}

func (*APIClient) Authenticate

func (c *APIClient) Authenticate() *APIClientError

func (*APIClient) BaseURL

func (c *APIClient) BaseURL() *url.URL

BaseURL returns a copy of baseUrl

func (*APIClient) DopplerToken

func (c *APIClient) DopplerToken() string

func (*APIClient) GetSecret

func (c *APIClient) GetSecret(request SecretRequest) (*SecretResult, *APIClientError)

func (*APIClient) GetSecrets

func (c *APIClient) GetSecrets(request SecretsRequest) (*SecretsResult, *APIClientError)

func (*APIClient) SetBaseURL

func (c *APIClient) SetBaseURL(urlStr string) error

func (*APIClient) SetDopplerToken

func (c *APIClient) SetDopplerToken(token string) error

type APIClientError

type APIClientError struct {
	Err     error
	Message string
	Data    string
}

func (*APIClientError) Error

func (e *APIClientError) Error() string

type APIErrorResponse

type APIErrorResponse struct {
	Messages []string
	Success  bool
}

type APIResponse

type APIResponse struct {
	HTTPResponse *http.Response
	Body         []byte
}

type Format

type Format string

type Headers

type Headers map[string]string

type NameTransformer

type NameTransformer string

type QueryParams

type QueryParams map[string]string

type SecretRequest

type SecretRequest struct {
	Name    string
	Project string
	Config  string
}

func (*SecretRequest) BuildQueryParams

func (r *SecretRequest) BuildQueryParams(name string) QueryParams

type SecretResponseBody

type SecretResponseBody struct {
	Name  string `json:"name,omitempty"`
	Value struct {
		Raw      *string `json:"raw"`
		Computed *string `json:"computed"`
	} `json:"value,omitempty"`
	Messages *[]string `json:"messages,omitempty"`
	Success  bool      `json:"success"`
}

type SecretResult

type SecretResult struct {
	Name  string
	Value string
}

type Secrets

type Secrets map[string]string

func SortSecrets

func SortSecrets(secrets Secrets) Secrets

SortSecrets alphabetically for deterministic order.

type SecretsData

type SecretsData map[string]string

type SecretsRequest

type SecretsRequest struct {
	Project               string
	Config                string
	NameTransformer       NameTransformer
	Format                Format
	IncludeDynamicSecrets bool
	DynamicSecretsTTL     int32
	LastETag              string
}

func (*SecretsRequest) BuildHeaders

func (r *SecretsRequest) BuildHeaders() Headers

func (*SecretsRequest) BuildQueryParams

func (r *SecretsRequest) BuildQueryParams() (QueryParams, error)

type SecretsResult

type SecretsResult struct {
	Secrets  Secrets
	Modified bool
	ETag     string
}

Jump to

Keyboard shortcuts

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