Documentation ¶
Index ¶
- Constants
- type ConfigOptions
- type GoMySQLServerConfig
- func (c *GoMySQLServerConfig) DSN() (string, error)
- func (c *GoMySQLServerConfig) Database() string
- func (c *GoMySQLServerConfig) Host() string
- func (c *GoMySQLServerConfig) Listener() *bufconn.Listener
- func (c *GoMySQLServerConfig) Password() string
- func (c *GoMySQLServerConfig) Port() int
- func (c *GoMySQLServerConfig) Socket() string
- func (c *GoMySQLServerConfig) Transport() Transport
- func (c *GoMySQLServerConfig) User() string
- type GoMySQLServerConfigOption
- func WithDatabase(database string) GoMySQLServerConfigOption
- func WithHost(host string) GoMySQLServerConfigOption
- func WithPassword(password string) GoMySQLServerConfigOption
- func WithPort(port int) GoMySQLServerConfigOption
- func WithSocket(socket string) GoMySQLServerConfigOption
- func WithTransport(transport Transport) GoMySQLServerConfigOption
- func WithUser(user string) GoMySQLServerConfigOption
- type Transport
Constants ¶
const ( DefaultUser = "user" DefaultPassword = "password" DefaultSocket = "/tmp/mysql.sock" DefaultHost = "localhost" DefaultPort = 3306 DefaultDatabase = "db" DefaultMemoryNetwork = "memory" DefaultMemoryAddress = "bufconn" DefaultMemoryBufferSize = 1024 * 1024 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigOptions ¶
type ConfigOptions struct { Transport Transport Listener *bufconn.Listener User string Password string Socket string Host string Port int Database string }
ConfigOptions are options for the [GoMySQLServerFactory] implementations.
func DefaultGoMySQLServerConfigOptions ¶
func DefaultGoMySQLServerConfigOptions() ConfigOptions
DefaultGoMySQLServerConfigOptions are the default options used in the [DefaultGoMySQLServerFactory].
type GoMySQLServerConfig ¶
type GoMySQLServerConfig struct {
// contains filtered or unexported fields
}
GoMySQLServerConfig is the server configuration.
func NewGoMySQLServerConfig ¶
func NewGoMySQLServerConfig(options ...GoMySQLServerConfigOption) *GoMySQLServerConfig
NewGoMySQLServerConfig returns a new GoMySQLServerConfig.
func (*GoMySQLServerConfig) DSN ¶
func (c *GoMySQLServerConfig) DSN() (string, error)
DSN returns the dsn, depending on the configuration transport.
func (*GoMySQLServerConfig) Database ¶
func (c *GoMySQLServerConfig) Database() string
Database returns the configuration database.
func (*GoMySQLServerConfig) Host ¶
func (c *GoMySQLServerConfig) Host() string
Host returns the configuration host.
func (*GoMySQLServerConfig) Listener ¶
func (c *GoMySQLServerConfig) Listener() *bufconn.Listener
Listener returns the configuration listener.
func (*GoMySQLServerConfig) Password ¶
func (c *GoMySQLServerConfig) Password() string
Password returns the configuration password.
func (*GoMySQLServerConfig) Port ¶
func (c *GoMySQLServerConfig) Port() int
Port returns the configuration port.
func (*GoMySQLServerConfig) Socket ¶
func (c *GoMySQLServerConfig) Socket() string
Socket returns the configuration socket.
func (*GoMySQLServerConfig) Transport ¶
func (c *GoMySQLServerConfig) Transport() Transport
Transport returns the configuration transport.
func (*GoMySQLServerConfig) User ¶
func (c *GoMySQLServerConfig) User() string
User returns the configuration user.
type GoMySQLServerConfigOption ¶
type GoMySQLServerConfigOption func(o *ConfigOptions)
GoMySQLServerConfigOption are functional options for the [GoMySQLServerFactory] implementations.
func WithDatabase ¶
func WithDatabase(database string) GoMySQLServerConfigOption
WithDatabase is used to specify the database.
func WithHost ¶
func WithHost(host string) GoMySQLServerConfigOption
WithHost is used to specify the host.
func WithPassword ¶
func WithPassword(password string) GoMySQLServerConfigOption
WithPassword is used to specify the password.
func WithPort ¶
func WithPort(port int) GoMySQLServerConfigOption
WithPort is used to specify the port.
func WithSocket ¶
func WithSocket(socket string) GoMySQLServerConfigOption
WithSocket is used to specify the socket.
func WithTransport ¶
func WithTransport(transport Transport) GoMySQLServerConfigOption
WithTransport is used to specify the Transport.
func WithUser ¶
func WithUser(user string) GoMySQLServerConfigOption
WithUser is used to specify the user.