Documentation ¶
Index ¶
- func Serve(db Database, tlsProvider func() (*tls.Config, error))
- type CreateUserRequest
- type CreateUserResponse
- type Database
- type DatabasePlugin
- type DatabasePluginClient
- func (dc *DatabasePluginClient) Close() error
- func (dr DatabasePluginClient) CreateUser(statements Statements, usernamePrefix string, expiration time.Time) (username string, password string, err error)
- func (dr DatabasePluginClient) Initialize(conf map[string]interface{}, verifyConnection bool) error
- func (dr DatabasePluginClient) RenewUser(statements Statements, username string, expiration time.Time) error
- func (dr DatabasePluginClient) RevokeUser(statements Statements, username string) error
- func (dr DatabasePluginClient) Type() (string, error)
- type InitializeRequest
- type RenewUserRequest
- type RevokeUserRequest
- type Statements
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CreateUserRequest ¶
type CreateUserRequest struct { Statements Statements UsernamePrefix string Expiration time.Time }
type CreateUserResponse ¶
type Database ¶
type Database interface { Type() (string, error) CreateUser(statements Statements, usernamePrefix string, expiration time.Time) (username string, password string, err error) RenewUser(statements Statements, username string, expiration time.Time) error RevokeUser(statements Statements, username string) error Initialize(config map[string]interface{}, verifyConnection bool) error Close() error }
Database is the interface that all database objects must implement.
func PluginFactory ¶
func PluginFactory(pluginName string, sys pluginutil.LookRunnerUtil, logger log.Logger) (Database, error)
PluginFactory is used to build plugin database types. It wraps the database object in a logging and metrics middleware.
type DatabasePlugin ¶
type DatabasePlugin struct {
// contains filtered or unexported fields
}
DatabasePlugin implements go-plugin's Plugin interface. It has methods for retrieving a server and a client instance of the plugin.
func (DatabasePlugin) Client ¶
func (DatabasePlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)
func (DatabasePlugin) Server ¶
func (d DatabasePlugin) Server(*plugin.MuxBroker) (interface{}, error)
type DatabasePluginClient ¶
DatabasePluginClient embeds a databasePluginRPCClient and wraps it's Close method to also call Kill() on the plugin.Client.
func (*DatabasePluginClient) Close ¶
func (dc *DatabasePluginClient) Close() error
func (DatabasePluginClient) CreateUser ¶
func (DatabasePluginClient) Initialize ¶
func (DatabasePluginClient) RenewUser ¶
func (dr DatabasePluginClient) RenewUser(statements Statements, username string, expiration time.Time) error
func (DatabasePluginClient) RevokeUser ¶
func (dr DatabasePluginClient) RevokeUser(statements Statements, username string) error
type InitializeRequest ¶
type RenewUserRequest ¶
type RenewUserRequest struct { Statements Statements Username string Expiration time.Time }
type RevokeUserRequest ¶
type RevokeUserRequest struct { Statements Statements Username string }
type Statements ¶
type Statements struct { CreationStatements string `json:"creation_statments" mapstructure:"creation_statements" structs:"creation_statments"` RevocationStatements string `json:"revocation_statements" mapstructure:"revocation_statements" structs:"revocation_statements"` RollbackStatements string `json:"rollback_statements" mapstructure:"rollback_statements" structs:"rollback_statements"` RenewStatements string `json:"renew_statements" mapstructure:"renew_statements" structs:"renew_statements"` }
Statements set in role creation and passed into the database type's functions.
Click to show internal directories.
Click to hide internal directories.