provider

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MPL-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuthOptionModelTypes = map[string]attr.Type{
	"plugin":          types.StringType,
	"auth_string":     types.StringType,
	"random_password": types.BoolType,
}
View Source
var PrivlilegeTypeModelTypes = map[string]attr.Type{
	"priv_type": types.StringType,
	"columns":   types.SetType{ElemType: types.StringType},
}
View Source
var RoleTypes = map[string]attr.Type{
	"name": types.StringType,
	"host": types.StringType,
}

Functions

func New

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

func NewDatabaseDataSource added in v0.2.0

func NewDatabaseDataSource() datasource.DataSource

func NewDatabaseResource

func NewDatabaseResource() resource.Resource

func NewDefaultRolesResource

func NewDefaultRolesResource() resource.Resource

func NewGlobalVariableResource

func NewGlobalVariableResource() resource.Resource

func NewGrantPrivilegeResource

func NewGrantPrivilegeResource() resource.Resource

func NewGrantRoleResource

func NewGrantRoleResource() resource.Resource

func NewRoleResource

func NewRoleResource() resource.Resource

func NewTablesDataSource

func NewTablesDataSource() datasource.DataSource

func NewUserResource

func NewUserResource() resource.Resource

Types

type AuthOptionModel

type AuthOptionModel struct {
	Plugin         types.String `tfsdk:"plugin"`
	AuthString     types.String `tfsdk:"auth_string"`
	RandomPassword types.Bool   `tfsdk:"random_password"`
}

type DatabaseDataSource added in v0.2.0

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

func (*DatabaseDataSource) Configure added in v0.2.0

func (*DatabaseDataSource) Metadata added in v0.2.0

func (*DatabaseDataSource) Read added in v0.2.0

func (*DatabaseDataSource) Schema added in v0.2.0

type DatabaseDataSourceModel added in v0.2.0

type DatabaseDataSourceModel struct {
	ID                  types.String `tfsdk:"id"`
	Database            types.String `tfsdk:"database"`
	DefaultCharacterSet types.String `tfsdk:"default_character_set"`
	DefaultCollation    types.String `tfsdk:"default_collation"`
}

type DefaultRolesResource

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

DefaultRolesResource defines the resource implementation.

func (*DefaultRolesResource) Configure

func (*DefaultRolesResource) Create

func (*DefaultRolesResource) Delete

func (*DefaultRolesResource) ImportState

func (*DefaultRolesResource) Metadata

func (*DefaultRolesResource) Read

func (*DefaultRolesResource) Schema

func (*DefaultRolesResource) Update

type DefaultRolesResourceModel

type DefaultRolesResourceModel struct {
	ID           types.String `tfsdk:"id"`
	User         types.String `tfsdk:"user"`
	Host         types.String `tfsdk:"host"`
	DefaultRoles types.Set    `tfsdk:"default_role"`
}

DefaultRolesResourceModel describes the resource data model.

type GlobalVariableResource

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

GlobalVariableResource defines the resource implementation.

func (*GlobalVariableResource) Configure

func (*GlobalVariableResource) Create

func (*GlobalVariableResource) Delete

func (*GlobalVariableResource) ImportState

func (*GlobalVariableResource) Metadata

func (*GlobalVariableResource) Read

func (*GlobalVariableResource) Schema

func (*GlobalVariableResource) Update

type GlobalVariableResourceModel

type GlobalVariableResourceModel struct {
	ID    types.String `tfsdk:"id"`
	Name  types.String `tfsdk:"name"`
	Value types.String `tfsdk:"value"`
}

GlobalVariableResourceModel describes the resource data model.

type GrantPrivilege

type GrantPrivilege struct {
	DBName      string
	TableName   string
	Username    string
	Hostname    string
	Privileges  []*ast.PrivElem
	GrantOption bool
}

func ParseGrantPrivilegeStatement

func ParseGrantPrivilegeStatement(sql string) (*GrantPrivilege, error)

func (*GrantPrivilege) Enter

func (v *GrantPrivilege) Enter(in ast.Node) (ast.Node, bool)

func (*GrantPrivilege) Leave

func (v *GrantPrivilege) Leave(in ast.Node) (ast.Node, bool)

func (*GrantPrivilege) Match

func (v *GrantPrivilege) Match(dbName, tableName, username, hostname string) bool

func (*GrantPrivilege) PrivString

func (v *GrantPrivilege) PrivString() string

type GrantPrivilegeResource

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

GrantPrivilegeResource defines the resource implementation.

func (*GrantPrivilegeResource) Configure

func (*GrantPrivilegeResource) Create

func (*GrantPrivilegeResource) Delete

func (*GrantPrivilegeResource) ImportState

func (*GrantPrivilegeResource) Metadata

func (*GrantPrivilegeResource) Read

func (*GrantPrivilegeResource) Schema

func (*GrantPrivilegeResource) Update

type GrantPrivilegeResourceModel

type GrantPrivilegeResourceModel struct {
	ID          types.String `tfsdk:"id"`
	Privileges  types.Set    `tfsdk:"privilege"`
	On          types.Object `tfsdk:"on"`
	To          types.Object `tfsdk:"to"`
	GrantOption types.Bool   `tfsdk:"grant_option"`
}

GrantPrivilegeResourceModel describes the resource data model.

type GrantRoleResource

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

GrantRoleResource defines the resource implementation.

func (*GrantRoleResource) Configure

func (*GrantRoleResource) Create

func (*GrantRoleResource) Delete

func (*GrantRoleResource) ImportState

func (*GrantRoleResource) Metadata

func (*GrantRoleResource) Read

func (*GrantRoleResource) Schema

func (*GrantRoleResource) Update

type GrantRoleResourceModel

type GrantRoleResourceModel struct {
	ID          types.String `tfsdk:"id"`
	Roles       types.Set    `tfsdk:"role"`
	To          types.Object `tfsdk:"to"`
	AdminOption types.Bool   `tfsdk:"admin_option"`
}

GrantRoleResourceModel describes the resource data model.

type MySQLConfiguration

type MySQLConfiguration struct {
	Config                 *mysql.Config
	MaxConnLifetime        time.Duration
	MaxOpenConns           int
	ConnectRetryTimeoutSec time.Duration
}

type OneConnection

type OneConnection struct {
	Db      *sql.DB
	Version *version.Version
}

type PrivilegeLevelModel

type PrivilegeLevelModel struct {
	Database types.String `tfsdk:"database"`
	Table    types.String `tfsdk:"table"`
}

type PrivilegeTypeModel

type PrivilegeTypeModel struct {
	PrivType types.String `tfsdk:"priv_type"`
	Columns  types.Set    `tfsdk:"columns"`
}

type PrivilegeTypeRaw added in v0.1.4

type PrivilegeTypeRaw struct {
	PrivType string   `diff:"priv_type"`
	Columns  []string `diff:"columns"`
}

type RoleModel

type RoleModel struct {
	Name types.String `tfsdk:"name"`
	Host types.String `tfsdk:"host"`
}

func NewRandomRole added in v0.1.4

func NewRandomRole(prefix, host string) RoleModel

func NewRole added in v0.1.4

func NewRole(name, host string) RoleModel

func (*RoleModel) GetHost added in v0.1.4

func (r *RoleModel) GetHost() string

func (*RoleModel) GetID added in v0.1.4

func (r *RoleModel) GetID() string

func (*RoleModel) GetName added in v0.1.4

func (r *RoleModel) GetName() string

type RoleModelRaw added in v0.3.0

type RoleModelRaw struct {
	Name string `diff:"name"`
	Host string `diff:"host"`
}

func NewRoleRaw added in v0.3.0

func NewRoleRaw(name, host string) RoleModelRaw

type RoleResource

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

RoleResource defines the resource implementation.

func (*RoleResource) Configure

func (*RoleResource) Create

func (*RoleResource) Delete

func (*RoleResource) ImportState

func (*RoleResource) Metadata

func (*RoleResource) Read

func (*RoleResource) Schema

func (*RoleResource) Update

type RoleResourceModel

type RoleResourceModel struct {
	ID   types.String `tfsdk:"id"`
	Name types.String `tfsdk:"name"`
	Host types.String `tfsdk:"host"`
}

RoleResourceModel describes the resource data model.

type TablesDataSource added in v0.2.0

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

func (*TablesDataSource) Configure added in v0.2.0

func (*TablesDataSource) Metadata added in v0.2.0

func (*TablesDataSource) Read added in v0.2.0

func (*TablesDataSource) Schema added in v0.2.0

type TablesDataSourceModel added in v0.2.0

type TablesDataSourceModel struct {
	ID       types.String   `tfsdk:"id"`
	Database types.String   `tfsdk:"database"`
	Pattern  types.String   `tfsdk:"pattern"`
	Tables   []types.String `tfsdk:"tables"`
}

type UserModel

type UserModel struct {
	Name types.String `tfsdk:"name"`
	Host types.String `tfsdk:"host"`
}

func NewRandomUser added in v0.1.4

func NewRandomUser(prefix, host string) UserModel

func NewUser added in v0.1.4

func NewUser(name, host string) UserModel

func (*UserModel) GetHost added in v0.1.4

func (u *UserModel) GetHost() string

func (*UserModel) GetID added in v0.1.4

func (u *UserModel) GetID() string

func (*UserModel) GetName added in v0.1.4

func (u *UserModel) GetName() string

type UserResource

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

UserResource defines the resource implementation.

func (*UserResource) ConfigValidators

func (r *UserResource) ConfigValidators(ctx context.Context) []resource.ConfigValidator

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"`
	Name       types.String `tfsdk:"name"`
	Host       types.String `tfsdk:"host"`
	Lock       types.Bool   `tfsdk:"lock"`
	AuthOption types.Object `tfsdk:"auth_option"`
}

UserResourceModel describes the resource data model.

Jump to

Keyboard shortcuts

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