Documentation ¶
Index ¶
- func New() (interface{}, error)
- type RedShift
- func (r *RedShift) DeleteUser(ctx context.Context, req dbplugin.DeleteUserRequest) (dbplugin.DeleteUserResponse, error)
- func (r *RedShift) Initialize(ctx context.Context, req dbplugin.InitializeRequest) (dbplugin.InitializeResponse, error)
- func (r *RedShift) NewUser(ctx context.Context, req dbplugin.NewUserRequest) (dbplugin.NewUserResponse, error)
- func (r *RedShift) Type() (string, error)
- func (r *RedShift) UpdateUser(ctx context.Context, req dbplugin.UpdateUserRequest) (dbplugin.UpdateUserResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RedShift ¶
type RedShift struct {
*connutil.SQLConnectionProducer
}
func (*RedShift) DeleteUser ¶
func (r *RedShift) DeleteUser(ctx context.Context, req dbplugin.DeleteUserRequest) (dbplugin.DeleteUserResponse, error)
DeleteUser supports both default and custom statements to delete a user.
func (*RedShift) Initialize ¶
func (r *RedShift) Initialize(ctx context.Context, req dbplugin.InitializeRequest) (dbplugin.InitializeResponse, error)
Initialize must be called on each new RedShift struct before use. It uses the connutil.SQLConnectionProducer's Init function to do all the lifting.
func (*RedShift) NewUser ¶
func (r *RedShift) NewUser(ctx context.Context, req dbplugin.NewUserRequest) (dbplugin.NewUserResponse, error)
NewUser creates a new user in the database. There is no default statement for creating users, so one must be specified in the plugin config. Generated usernames are of the form v-{display-name}-{role-name}-{UUID}-{timestamp}
func (*RedShift) UpdateUser ¶
func (r *RedShift) UpdateUser(ctx context.Context, req dbplugin.UpdateUserRequest) (dbplugin.UpdateUserResponse, error)
UpdateUser can update the expiration or the password of a user, or both. The updates all happen in a single transaction, so they will either all succeed or all fail. Both updates support both default and custom statements.