provider

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MPL-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultTimeout = 30 * time.Second
)

Ensure the implementation satisfies the expected interfaces.

Functions

func New

func New(version string) func() provider.Provider

New is a helper function to simplify provider server and testing implementation.

func NewUserResource

func NewUserResource() resource.Resource

func NewUsersDataSource

func NewUsersDataSource() datasource.DataSource

Types

type UserDataSourceModel

type UserDataSourceModel struct {
	ID         types.String              `tfsdk:"id"`
	User       types.String              `tfsdk:"user"`
	DB         types.String              `tfsdk:"db"`
	CustomData map[string]types.String   `tfsdk:"custom_data"`
	Roles      []UserRoleDataSourceModel `tfsdk:"roles"`
	Mechanisms []types.String            `tfsdk:"mechanisms"`
}

type UserResource

type UserResource struct {
	// contains filtered or unexported fields
}

UserResource defines the resource implementation.

func (*UserResource) Configure

func (*UserResource) Create

func (*UserResource) Delete

func (*UserResource) ImportState

func (*UserResource) Metadata

func (*UserResource) Read

func (*UserResource) Schema

func (*UserResource) Update

type UserResourceModel

type UserResourceModel struct {
	ID         types.String            `tfsdk:"id"`
	User       types.String            `tfsdk:"user"`
	DB         types.String            `tfsdk:"db"`
	Password   types.String            `tfsdk:"pwd"`
	CustomData map[string]types.String `tfsdk:"custom_data"`
	Roles      []UserRoleResourceModel `tfsdk:"roles"`
	Mechanisms []types.String          `tfsdk:"mechanisms"`
	Timeouts   timeouts.Value          `tfsdk:"timeouts"`
}

UserResourceModel describes the resource data model.

type UserRoleDataSourceModel

type UserRoleDataSourceModel struct {
	Role types.String `tfsdk:"role"`
	DB   types.String `tfsdk:"db"`
}

type UserRoleResourceModel

type UserRoleResourceModel struct {
	Role types.String `tfsdk:"role"`
	DB   types.String `tfsdk:"db"`
}

type UsersDataSource

type UsersDataSource struct {
	// contains filtered or unexported fields
}

func (*UsersDataSource) Configure

Configure adds the provider configured client to the data source.

func (*UsersDataSource) Metadata

func (*UsersDataSource) Read

func (*UsersDataSource) Schema

type UsersDataSourceModel

type UsersDataSourceModel struct {
	DB    types.String          `tfsdk:"db"`
	Users []UserDataSourceModel `tfsdk:"users"`

	// MongoDB support more dynamic filters, but due to Terraform Plugin Framework
	// not supporting dynamic types, we have to settle on a simple map.
	// See: https://github.com/hashicorp/terraform-plugin-framework/issues/147
	Filter   map[string]string `tfsdk:"filter"`
	Timeouts timeouts.Value    `tfsdk:"timeouts"`
}

Jump to

Keyboard shortcuts

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