resourcerole

package
v1.0.33 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllowedPrivileges = []string{
	"SELECT",
	"INSERT",
	"ALTER",
	"CREATE DATABASE",
	"CREATE TABLE",
	"CREATE VIEW",
	"CREATE DICTIONARY",
	"DROP DATABASE",
	"DROP TABLE",
	"SHOW TABLES"}

Functions

func ResourceRole

func ResourceRole() *schema.Resource

func ValidatePrivileges

func ValidatePrivileges(privileges *schema.Set) diag.Diagnostics

Types

type CHGrant

type CHGrant struct {
	RoleName   string `ch:"role_name"`
	AccessType string `ch:"access_type"`
	Database   string `ch:"database"`
}

type CHRole

type CHRole struct {
	Name       string `ch:"name"`
	Privileges []CHGrant
}

func (*CHRole) GetPrivilegesList

func (r *CHRole) GetPrivilegesList() []string

func (*CHRole) ToRoleResource

func (r *CHRole) ToRoleResource() (*RoleResource, error)

type CHRoleService

type CHRoleService struct {
	CHConnection *driver.Conn
}

func (*CHRoleService) CreateRole

func (rs *CHRoleService) CreateRole(ctx context.Context, name string, database string, privileges []string) (*CHRole, error)

func (*CHRoleService) DeleteRole

func (rs *CHRoleService) DeleteRole(ctx context.Context, name string) error

func (*CHRoleService) GetRole

func (rs *CHRoleService) GetRole(ctx context.Context, roleName string) (*CHRole, error)

func (*CHRoleService) UpdateRole

func (rs *CHRoleService) UpdateRole(ctx context.Context, rolePlan RoleResource, resourceData *schema.ResourceData) (*CHRole, error)

type RoleResource

type RoleResource struct {
	Name       string
	Database   string
	Privileges *schema.Set
}

Jump to

Keyboard shortcuts

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