Documentation
¶
Overview ¶
Package environments provides a client for the Doppler API's environments endpoints.
API-Docs: https://docs.doppler.com/reference/environment-object
Example:
// Fetch all environments of a project
environments, _, err := environment.List(ctx, &doppler.EnvironmentListOptions{
Project: "my-project",
})
if err != nil {
log.Fatal(err)
}
// Print the slug of each environment
for _, env := range environments {
fmt.Println(env.ID)
}
Index ¶
- func Create(ctx context.Context, opts *doppler.EnvironmentCreateOptions) (*doppler.Environment, doppler.APIResponse, error)
- func Delete(ctx context.Context, opts *doppler.EnvironmentDeleteOptions) (doppler.APIResponse, error)
- func Get(ctx context.Context, opts *doppler.EnvironmentGetOptions) (*doppler.Environment, doppler.APIResponse, error)
- func List(ctx context.Context, opts *doppler.EnvironmentListOptions) ([]*doppler.Environment, doppler.APIResponse, error)
- func Rename(ctx context.Context, environment *doppler.EnvironmentRenameOptions) (*doppler.Environment, doppler.APIResponse, error)
- type Client
- func (c Client) Create(ctx context.Context, opts *doppler.EnvironmentCreateOptions) (*doppler.Environment, doppler.APIResponse, error)
- func (c Client) Delete(ctx context.Context, opts *doppler.EnvironmentDeleteOptions) (doppler.APIResponse, error)
- func (c Client) Get(ctx context.Context, opts *doppler.EnvironmentGetOptions) (*doppler.Environment, doppler.APIResponse, error)
- func (c Client) List(ctx context.Context, opts *doppler.EnvironmentListOptions) ([]*doppler.Environment, doppler.APIResponse, error)
- func (c Client) Rename(ctx context.Context, environment *doppler.EnvironmentRenameOptions) (*doppler.Environment, doppler.APIResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(ctx context.Context, opts *doppler.EnvironmentCreateOptions) (*doppler.Environment, doppler.APIResponse, error)
Create creates a new environment using the default client.
func Delete ¶
func Delete(ctx context.Context, opts *doppler.EnvironmentDeleteOptions) (doppler.APIResponse, error)
Delete deletes an existing environment using the default client.
func Get ¶
func Get(ctx context.Context, opts *doppler.EnvironmentGetOptions) (*doppler.Environment, doppler.APIResponse, error)
Get returns an environment and its respective info using the default client.
func List ¶
func List(ctx context.Context, opts *doppler.EnvironmentListOptions) ([]*doppler.Environment, doppler.APIResponse, error)
List returns a list of environments using the default client.
func Rename ¶
func Rename(ctx context.Context, environment *doppler.EnvironmentRenameOptions) (*doppler.Environment, doppler.APIResponse, error)
Rename renames an existing environment using the default client.
Types ¶
type Client ¶
Client is the client used to invoke /v3/environments APIs.
func Default ¶
func Default() *Client
Default returns a new client based on the SDK's default backend and API key.
func (Client) Create ¶
func (c Client) Create(ctx context.Context, opts *doppler.EnvironmentCreateOptions) (*doppler.Environment, doppler.APIResponse, error)
Create creates a new environment.
func (Client) Delete ¶
func (c Client) Delete(ctx context.Context, opts *doppler.EnvironmentDeleteOptions) (doppler.APIResponse, error)
Delete deletes an existing environment.
func (Client) Get ¶
func (c Client) Get(ctx context.Context, opts *doppler.EnvironmentGetOptions) (*doppler.Environment, doppler.APIResponse, error)
Get returns an environment and its respective info.
func (Client) List ¶
func (c Client) List(ctx context.Context, opts *doppler.EnvironmentListOptions) ([]*doppler.Environment, doppler.APIResponse, error)
List returns a list of environments.
func (Client) Rename ¶
func (c Client) Rename(ctx context.Context, environment *doppler.EnvironmentRenameOptions) (*doppler.Environment, doppler.APIResponse, error)
Rename renames an existing environment.