Documentation ¶
Index ¶
- Constants
- Variables
- func ExecuteClickHouseQuery(ctx context.Context, avnGen avngen.Client, ...) (*clickhouse.ServiceClickHouseQueryOut, error)
- func QueryDatabases(ctx context.Context, avnGen avngen.Client, projectName, serviceName string) ([]string, error)
- func QueryGrantees(ctx context.Context, avnGen avngen.Client, projectName, serviceName string) ([]string, error)
- func QueryPrivileges(ctx context.Context, avnGen avngen.Client, projectName, serviceName string) (*clickhouse.ServiceClickHouseQueryOut, error)
- func QueryRoleGrants(ctx context.Context, avnGen avngen.Client, projectName, serviceName string) (*clickhouse.ServiceClickHouseQueryOut, error)
- type DatabaseAndTable
- type Grant
- type StatementType
Constants ¶
View Source
const (
RoleGrantsQuery = "SELECT * FROM system.role_grants"
)
Variables ¶
View Source
var ( // 'aiven', 'aiven_monitoring', and 'avnadmin' are Aiven-managed users InternalAivenRoles = []string{"aiven", "aiven_monitoring", "avnadmin"} // "OR user_name IS NULL" is needed to include roles in the result QueryNonAivenPrivileges = fmt.Sprintf("SELECT * FROM system.grants WHERE user_name NOT IN('%s') OR user_name IS NULL", strings.Join(InternalAivenRoles, "', '")) )
Functions ¶
func ExecuteClickHouseQuery ¶
func ExecuteClickHouseQuery(ctx context.Context, avnGen avngen.Client, project, serviceName, statement string) (*clickhouse.ServiceClickHouseQueryOut, error)
func QueryDatabases ¶
func QueryGrantees ¶
func QueryPrivileges ¶
func QueryPrivileges(ctx context.Context, avnGen avngen.Client, projectName, serviceName string) (*clickhouse.ServiceClickHouseQueryOut, error)
func QueryRoleGrants ¶
func QueryRoleGrants(ctx context.Context, avnGen avngen.Client, projectName, serviceName string) (*clickhouse.ServiceClickHouseQueryOut, error)
Types ¶
type DatabaseAndTable ¶
func QueryTables ¶
type Grant ¶
type Grant interface { // Returns the 1. main part (privileges or roles), 2. grantees part and 3. query options ConstructParts(t StatementType) (string, string, string) }
TODO: Move to clickhousegrant_types.go once the issue below is resolved See: https://github.com/kubernetes-sigs/controller-tools/issues/383
type StatementType ¶
type StatementType string
const ( GRANT StatementType = "GRANT" REVOKE StatementType = "REVOKE" )
Click to show internal directories.
Click to hide internal directories.