doppler

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

View Source
const MAX_RETRIES = 10

Variables

View Source
var (
	ProviderVersion = "dev"
)

Functions

func Provider

func Provider() *schema.Provider

Types

type APIClient

type APIClient struct {
	Host      string
	APIKey    string
	VerifyTLS bool
}

func (APIClient) CreateConfig

func (client APIClient) CreateConfig(ctx context.Context, project string, environment string, name string) (*Config, error)

func (APIClient) CreateEnvironment

func (client APIClient) CreateEnvironment(ctx context.Context, project string, slug string, name string) (*Environment, error)

func (APIClient) CreateGroup added in v1.3.0

func (client APIClient) CreateGroup(ctx context.Context, name string, defaultProjectRole string) (*Group, error)

func (APIClient) CreateGroupMember added in v1.6.0

func (client APIClient) CreateGroupMember(ctx context.Context, group string, memberType string, memberSlug string) error

func (APIClient) CreateIntegration

func (client APIClient) CreateIntegration(ctx context.Context, data IntegrationData, name, integType string) (*Integration, error)

func (APIClient) CreateProject

func (client APIClient) CreateProject(ctx context.Context, name string, description string) (*Project, error)

func (APIClient) CreateProjectMember added in v1.3.0

func (client APIClient) CreateProjectMember(ctx context.Context, project string, memberType string, memberSlug string, role string, environments []string) (*ProjectMember, error)

func (APIClient) CreateServiceAccount added in v1.3.0

func (client APIClient) CreateServiceAccount(ctx context.Context, name string, workplaceRole string, workplacePermissions []string) (*ServiceAccount, error)

func (APIClient) CreateServiceToken

func (client APIClient) CreateServiceToken(ctx context.Context, project string, config string, access string, name string) (*ServiceToken, error)

func (APIClient) CreateSync

func (client APIClient) CreateSync(ctx context.Context, data SyncData, config, project, integration string) (*Sync, error)

func (APIClient) DeleteConfig

func (client APIClient) DeleteConfig(ctx context.Context, project string, name string) error

func (APIClient) DeleteEnvironment

func (client APIClient) DeleteEnvironment(ctx context.Context, project string, slug string) error

func (APIClient) DeleteGroup added in v1.3.0

func (client APIClient) DeleteGroup(ctx context.Context, slug string) error

func (APIClient) DeleteGroupMember added in v1.6.0

func (client APIClient) DeleteGroupMember(ctx context.Context, group string, memberType string, memberSlug string) error

func (APIClient) DeleteIntegration

func (client APIClient) DeleteIntegration(ctx context.Context, name string) error

func (APIClient) DeleteProject

func (client APIClient) DeleteProject(ctx context.Context, name string) error

func (APIClient) DeleteProjectMember added in v1.3.0

func (client APIClient) DeleteProjectMember(ctx context.Context, project string, memberType string, memberSlug string) error

func (APIClient) DeleteServiceAccount added in v1.3.0

func (client APIClient) DeleteServiceAccount(ctx context.Context, slug string) error

func (APIClient) DeleteServiceToken

func (client APIClient) DeleteServiceToken(ctx context.Context, project string, config string, slug string) error

func (APIClient) DeleteSync

func (client APIClient) DeleteSync(ctx context.Context, slug string, deleteTarget bool, config, project string) error

func (APIClient) GetComputedSecrets

func (client APIClient) GetComputedSecrets(ctx context.Context, project string, config string) ([]ComputedSecret, error)

func (APIClient) GetConfig

func (client APIClient) GetConfig(ctx context.Context, project string, name string) (*Config, error)

func (APIClient) GetEnvironment

func (client APIClient) GetEnvironment(ctx context.Context, project string, name string) (*Environment, error)

func (APIClient) GetGroup added in v1.3.0

func (client APIClient) GetGroup(ctx context.Context, slug string) (*Group, error)

func (APIClient) GetGroupMember added in v1.6.0

func (client APIClient) GetGroupMember(ctx context.Context, group string, memberType string, memberSlug string) error

func (APIClient) GetId

func (client APIClient) GetId() string

func (APIClient) GetIntegration

func (client APIClient) GetIntegration(ctx context.Context, slug string) (*Integration, error)

func (APIClient) GetProject

func (client APIClient) GetProject(ctx context.Context, name string) (*Project, error)

func (APIClient) GetProjectMember added in v1.3.0

func (client APIClient) GetProjectMember(ctx context.Context, project string, memberType string, memberSlug string) (*ProjectMember, error)

func (APIClient) GetSecret

func (client APIClient) GetSecret(ctx context.Context, project string, config string, secretName string) (*Secret, error)

func (APIClient) GetServiceAccount added in v1.3.0

func (client APIClient) GetServiceAccount(ctx context.Context, slug string) (*ServiceAccount, error)

func (APIClient) GetServiceTokens

func (client APIClient) GetServiceTokens(ctx context.Context, project string, config string) ([]ServiceToken, error)

func (APIClient) GetSync

func (client APIClient) GetSync(ctx context.Context, config, project, sync string) (*Sync, error)

func (APIClient) GetWorkplaceUser added in v1.6.0

func (client APIClient) GetWorkplaceUser(ctx context.Context, email string) (*WorkplaceUser, error)

func (APIClient) PerformRequest

func (client APIClient) PerformRequest(req *http.Request, params []QueryParam) (*APIResponse, error)

func (APIClient) PerformRequestWithRetry

func (client APIClient) PerformRequestWithRetry(ctx context.Context, method string, path string, params []QueryParam, body []byte) (*APIResponse, error)

func (APIClient) RenameConfig

func (client APIClient) RenameConfig(ctx context.Context, project string, currentName string, newName string) (*Config, error)

func (APIClient) RenameEnvironment

func (client APIClient) RenameEnvironment(ctx context.Context, project string, currentSlug string, newSlug string, newName string) (*Environment, error)

func (APIClient) UpdateGroup added in v1.3.0

func (client APIClient) UpdateGroup(ctx context.Context, slug string, name string, defaultProjectRole *string) (*Group, error)

func (APIClient) UpdateIntegration

func (client APIClient) UpdateIntegration(ctx context.Context, slug, name string, data IntegrationData) (*Integration, error)

func (APIClient) UpdateProject

func (client APIClient) UpdateProject(ctx context.Context, currentName string, newName string, description string) (*Project, error)

func (APIClient) UpdateProjectMember added in v1.3.0

func (client APIClient) UpdateProjectMember(ctx context.Context, project string, memberType string, memberSlug string, role *string, environments []string) (*ProjectMember, error)

func (APIClient) UpdateSecrets

func (client APIClient) UpdateSecrets(ctx context.Context, project string, config string, changeRequests []ChangeRequest) error

func (APIClient) UpdateServiceAccount added in v1.3.0

func (client APIClient) UpdateServiceAccount(ctx context.Context, slug string, name string, workplaceRole string, workplacePermissions []string) (*ServiceAccount, error)

type APIError

type APIError struct {
	Err        error
	Message    string
	RetryAfter *time.Duration
	Response   *APIResponse
}

func (*APIError) Error

func (e *APIError) Error() string

type APIResponse

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

type ChangeRequest

type ChangeRequest struct {
	OriginalName       *string `json:"originalName,omitempty"`
	OriginalValue      *string `json:"originalValue,omitempty"`
	OriginalVisibility *string `json:"originalVisibility,omitempty"`
	Name               string  `json:"name"`
	Value              *string `json:"value"`
	ShouldDelete       bool    `json:"shouldDelete"`
	Visibility         string  `json:"visibility,omitempty"`
}

type ComputedSecret

type ComputedSecret struct {
	Name  string
	Value string
}

func ParseComputedSecrets

func ParseComputedSecrets(response []byte) ([]ComputedSecret, error)

type Config

type Config struct {
	Slug        string `json:"slug"`
	Name        string `json:"name"`
	Project     string `json:"project"`
	Environment string `json:"environment"`
	Locked      bool   `json:"locked"`
	Root        bool   `json:"root"`
	CreatedAt   string `json:"created_at"`
}

type ConfigResponse

type ConfigResponse struct {
	Config Config `json:"config"`
}

type CustomNotFoundError

type CustomNotFoundError struct {
	Message string
}

func (*CustomNotFoundError) Error

func (e *CustomNotFoundError) Error() string

type Environment

type Environment struct {
	Slug      string `json:"slug"`
	Name      string `json:"name"`
	Project   string `json:"project"`
	CreatedAt string `json:"created_at"`
}

type EnvironmentResponse

type EnvironmentResponse struct {
	Environment Environment `json:"environment"`
}

type ErrorResponse

type ErrorResponse struct {
	Messages []string
	Success  bool
	Data     map[string]interface{}
}

type Group added in v1.3.0

type Group struct {
	Slug               string            `json:"slug"`
	Name               string            `json:"name"`
	CreatedAt          string            `json:"created_at"`
	DefaultProjectRole SimpleProjectRole `json:"default_project_role"`
}

type GroupIsMemberResponse added in v1.6.0

type GroupIsMemberResponse struct {
	IsMember bool `json:"isMember"`
}

type GroupResponse added in v1.3.0

type GroupResponse struct {
	Group Group `json:"group"`
}

type Integration

type Integration struct {
	Slug string `json:"slug"`
	Name string `json:"name"`
	Type string `json:"type"`
}

type IntegrationData

type IntegrationData = map[string]interface{}

type IntegrationDataBuilderFunc

type IntegrationDataBuilderFunc = func(d *schema.ResourceData) IntegrationData

type IntegrationResponse

type IntegrationResponse struct {
	Integration Integration `json:"integration"`
}

type Project

type Project struct {
	Slug        string `json:"slug"`
	Name        string `json:"name"`
	Description string `json:"description"`
	CreatedAt   string `json:"created_at"`
}

type ProjectMember added in v1.3.0

type ProjectMember struct {
	Type                  string            `json:"type"`
	Slug                  string            `json:"slug"`
	Role                  ProjectMemberRole `json:"role"`
	AccessAllEnvironments bool              `json:"access_all_environment"`
	Environments          []string          `json:"environments,omitempty"`
}

type ProjectMemberResponse added in v1.3.0

type ProjectMemberResponse struct {
	Member ProjectMember `json:"member"`
}

type ProjectMemberRole added in v1.3.0

type ProjectMemberRole struct {
	Identifier string `json:"identifier"`
}

type ProjectResponse

type ProjectResponse struct {
	Project Project `json:"project"`
}

type QueryParam

type QueryParam struct {
	Key   string
	Value string
}

type ResourceGroupMemberBuilder added in v1.6.0

type ResourceGroupMemberBuilder struct {
	// The Doppler member type
	MemberType string

	// Any additional schema fields for the resource
	DataSchema map[string]*schema.Schema

	// A function which uses the resource data to return a member slug
	GetMemberSlugFunc ResourceGroupMemberGetMemberSlugFunc
}

Builds a member-type-specific resource schema using the configuration params.

func (ResourceGroupMemberBuilder) Build added in v1.6.0

func (builder ResourceGroupMemberBuilder) Build() *schema.Resource

func (ResourceGroupMemberBuilder) CreateContextFunc added in v1.6.0

func (builder ResourceGroupMemberBuilder) CreateContextFunc() schema.CreateContextFunc

func (ResourceGroupMemberBuilder) DeleteContextFunc added in v1.6.0

func (builder ResourceGroupMemberBuilder) DeleteContextFunc() schema.DeleteContextFunc

func (ResourceGroupMemberBuilder) ReadContextFunc added in v1.6.0

func (builder ResourceGroupMemberBuilder) ReadContextFunc() schema.ReadContextFunc

type ResourceGroupMemberGetMemberSlugFunc added in v1.6.0

type ResourceGroupMemberGetMemberSlugFunc = func(ctx context.Context, d *schema.ResourceData, m interface{}) (*string, error)

type ResourceIntegrationBuilder

type ResourceIntegrationBuilder struct {
	Type        string
	DataSchema  map[string]*schema.Schema
	DataBuilder IntegrationDataBuilderFunc
}

func (ResourceIntegrationBuilder) Build

func (builder ResourceIntegrationBuilder) Build() *schema.Resource

resourceIntegration returns a schema resource object for the integration model.

func (ResourceIntegrationBuilder) CreateContextFunc

func (builder ResourceIntegrationBuilder) CreateContextFunc() schema.CreateContextFunc

func (ResourceIntegrationBuilder) DeleteContextFunc

func (builder ResourceIntegrationBuilder) DeleteContextFunc() schema.DeleteContextFunc

func (ResourceIntegrationBuilder) ReadContextFunc

func (builder ResourceIntegrationBuilder) ReadContextFunc() schema.ReadContextFunc

func (ResourceIntegrationBuilder) UpdateContextFunc

func (builder ResourceIntegrationBuilder) UpdateContextFunc() schema.UpdateContextFunc

type ResourceProjectMemberBuilder added in v1.3.0

type ResourceProjectMemberBuilder struct {
	// The Doppler member type
	MemberType string

	// Any additional schema fields for the resource
	DataSchema map[string]*schema.Schema

	// A function which uses the resource data to return a member slug
	GetMemberSlugFunc ResourceProjectMemberGetMemberSlugFunc
}

Builds a member-type-specific resource schema using the configuration params.

func (ResourceProjectMemberBuilder) Build added in v1.3.0

func (builder ResourceProjectMemberBuilder) Build() *schema.Resource

func (ResourceProjectMemberBuilder) CreateContextFunc added in v1.3.0

func (builder ResourceProjectMemberBuilder) CreateContextFunc() schema.CreateContextFunc

func (ResourceProjectMemberBuilder) DeleteContextFunc added in v1.3.0

func (builder ResourceProjectMemberBuilder) DeleteContextFunc() schema.DeleteContextFunc

func (ResourceProjectMemberBuilder) ReadContextFunc added in v1.3.0

func (builder ResourceProjectMemberBuilder) ReadContextFunc() schema.ReadContextFunc

func (ResourceProjectMemberBuilder) UpdateContextFunc added in v1.3.0

func (builder ResourceProjectMemberBuilder) UpdateContextFunc() schema.UpdateContextFunc

type ResourceProjectMemberGetMemberSlugFunc added in v1.3.0

type ResourceProjectMemberGetMemberSlugFunc = func(ctx context.Context, d *schema.ResourceData, m interface{}) (*string, error)

type ResourceSyncBuilder

type ResourceSyncBuilder struct {
	DataSchema  map[string]*schema.Schema
	DataBuilder IntegrationDataBuilderFunc
}

func (ResourceSyncBuilder) Build

func (builder ResourceSyncBuilder) Build() *schema.Resource

resourceSync returns a schema resource object for the Sync model.

func (ResourceSyncBuilder) CreateContextFunc

func (builder ResourceSyncBuilder) CreateContextFunc() schema.CreateContextFunc

func (ResourceSyncBuilder) DeleteContextFunc

func (builder ResourceSyncBuilder) DeleteContextFunc() schema.DeleteContextFunc

func (ResourceSyncBuilder) ReadContextFunc

func (builder ResourceSyncBuilder) ReadContextFunc() schema.ReadContextFunc

type Secret

type Secret struct {
	Name  string      `json:"name"`
	Value SecretValue `json:"value"`
}

type SecretValue

type SecretValue struct {
	Raw                *string `json:"raw,omitempty"`
	Computed           *string `json:"computed,omitempty"`
	RawVisibility      *string `json:"rawVisibility,omitempty"`
	ComputedVisibility *string `json:"computedVisibility,omitempty"`
}

type ServiceAccount added in v1.3.0

type ServiceAccount struct {
	Slug          string        `json:"slug"`
	Name          string        `json:"name"`
	CreatedAt     string        `json:"created_at"`
	WorkplaceRole WorkplaceRole `json:"workplace_role"`
}

type ServiceAccountResponse added in v1.3.0

type ServiceAccountResponse struct {
	ServiceAccount ServiceAccount `json:"service_account"`
}

type ServiceToken

type ServiceToken struct {
	Slug        string `json:"slug"`
	Name        string `json:"name"`
	Project     string `json:"project"`
	Environment string `json:"environment"`
	Config      string `json:"config"`
	Access      string `json:"access"`
	Key         string `json:"key"`
	CreatedAt   string `json:"created_at"`
}

type ServiceTokenListResponse

type ServiceTokenListResponse struct {
	ServiceTokens []ServiceToken `json:"tokens"`
}

type ServiceTokenResponse

type ServiceTokenResponse struct {
	ServiceToken ServiceToken `json:"token"`
}

type SimpleProjectRole added in v1.3.0

type SimpleProjectRole struct {
	Identifier string `json:"identifier"`
}

type Sync

type Sync struct {
	Slug        string `json:"slug"`
	Project     string `json:"project"`
	Config      string `json:"config"`
	Integration string `json:"integration"`
}

type SyncData

type SyncData = map[string]interface{}

type SyncDataBuilderFunc

type SyncDataBuilderFunc = func(d *schema.ResourceData) SyncData

type SyncResponse

type SyncResponse struct {
	Sync Sync `json:"sync"`
}

type WorkplaceRole added in v1.3.0

type WorkplaceRole struct {
	Name         string   `json:"name"`
	Permissions  []string `json:"permissions"`
	Identifier   string   `json:"identifier,omitempty"`
	IsCustomRole bool     `json:"is_custom_role"`
	IsInlineRole bool     `json:"is_inline_role"`
	CreatedAt    string   `json:"created_at"`
}

type WorkplaceUser added in v1.6.0

type WorkplaceUser struct {
	Slug string `json:"id"`
}

type WorkplaceUsersListResponse added in v1.6.0

type WorkplaceUsersListResponse struct {
	WorkplaceUsers []WorkplaceUser `json:"workplace_users"`
}

Jump to

Keyboard shortcuts

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