Documentation
¶
Index ¶
- Variables
- func New() (interface{}, error)
- func Run(apiTLSConfig *api.TLSConfig) error
- type ConnectionProducer
- type SQLConnectionProducer
- func (c *SQLConnectionProducer) Close() error
- func (c *SQLConnectionProducer) Connection(ctx context.Context) (interface{}, error)
- func (c *SQLConnectionProducer) Init(ctx context.Context, conf map[string]interface{}, verifyConnection bool) (map[string]interface{}, error)
- func (c *SQLConnectionProducer) Initialize(ctx context.Context, conf map[string]interface{}, verifyConnection bool) error
- func (c *SQLConnectionProducer) SecretValues() map[string]interface{}
- type SYBASE
- func (m *SYBASE) CreateUser(ctx context.Context, statements dbplugin.Statements, ...) (username string, password string, err error)
- func (m *SYBASE) RenewUser(ctx context.Context, statements dbplugin.Statements, username string, ...) error
- func (m *SYBASE) RevokeUser(ctx context.Context, statements dbplugin.Statements, username string) error
- func (m *SYBASE) RotateRootCredentials(ctx context.Context, statements []string) (map[string]interface{}, error)
- func (m *SYBASE) Type() (string, error)
Constants ¶
This section is empty.
Variables ¶
var (
ErrNotInitialized = errors.New("connection has not been initalized")
)
Functions ¶
Types ¶
type ConnectionProducer ¶
type ConnectionProducer interface {
Close() error
Init(context.Context, map[string]interface{}, bool) (map[string]interface{}, error)
Connection(context.Context) (interface{}, error)
sync.Locker
// DEPRECATED, will be removed in 0.12
Initialize(context.Context, map[string]interface{}, bool) error
}
ConnectionProducer can be used as an embeded interface in the Database definition. It implements the methods dealing with individual database connections and is used in all the builtin database types.
type SQLConnectionProducer ¶
type SQLConnectionProducer struct {
ConnectionURL string `json:"connection_url" mapstructure:"connection_url" structs:"connection_url"`
MaxOpenConnections int `json:"max_open_connections" mapstructure:"max_open_connections" structs:"max_open_connections"`
MaxIdleConnections int `json:"max_idle_connections" mapstructure:"max_idle_connections" structs:"max_idle_connections"`
MaxConnectionLifetimeRaw interface{} `json:"max_connection_lifetime" mapstructure:"max_connection_lifetime" structs:"max_connection_lifetime"`
Username string `json:"username" mapstructure:"username" structs:"username"`
Password string `json:"password" mapstructure:"password" structs:"password"`
Type string
RawConfig map[string]interface{}
Initialized bool
sync.Mutex
// contains filtered or unexported fields
}
SQLConnectionProducer implements ConnectionProducer and provides a generic producer for most sql databases
func (*SQLConnectionProducer) Close ¶
func (c *SQLConnectionProducer) Close() error
Close attempts to close the connection
func (*SQLConnectionProducer) Connection ¶
func (c *SQLConnectionProducer) Connection(ctx context.Context) (interface{}, error)
func (*SQLConnectionProducer) Initialize ¶
func (*SQLConnectionProducer) SecretValues ¶
func (c *SQLConnectionProducer) SecretValues() map[string]interface{}
type SYBASE ¶
type SYBASE struct {
*SQLConnectionProducer
credsutil.CredentialsProducer
}
SYBASE is an implementation of Database interface
func (*SYBASE) CreateUser ¶
func (m *SYBASE) CreateUser(ctx context.Context, statements dbplugin.Statements, usernameConfig dbplugin.UsernameConfig, expiration time.Time) (username string, password string, err error)
CreateUser generates the username/password on the underlying SYBASE secret backend as instructed by the CreationStatement provided.
func (*SYBASE) RenewUser ¶
func (m *SYBASE) RenewUser(ctx context.Context, statements dbplugin.Statements, username string, expiration time.Time) error
RenewUser is not supported on SYBASE, so this is a no-op.
func (*SYBASE) RevokeUser ¶
func (m *SYBASE) RevokeUser(ctx context.Context, statements dbplugin.Statements, username string) error
RevokeUser attempts to drop the specified user. It will first attempt to disable login, then drop the login and user from the database instance.