sql

package
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Version = ".."
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	*TLSConf
	// contains filtered or unexported fields
}

Config stores server configuration parammeters.

func NewDefaultConfig

func NewDefaultConfig() *Config

NewDefaultConfig returns a default configuration instance.

func (*Config) Address

func (config *Config) Address() string

Address returns a listen address from the configuration.

func (*Config) SetAddress

func (config *Config) SetAddress(addr string)

SetAddress sets a listen address to the configuration.

type Conn

type Conn interface {
	sql.Conn
}

Conn represents a connection.

type ConnID

type ConnID = sql.ConnID

ConnID represents a connection ID.

type Server

type Server struct {
}

Server represents a SQL server.

func NewServer

func NewServer() *Server

NewServer creates a new SQL server.

func (*Server) Restart

func (server *Server) Restart() error

Restart restarts the SQL server.

func (*Server) Start

func (server *Server) Start() error

Start starts the SQL server.

func (*Server) Stop

func (server *Server) Stop() error

Stop stops the SQL server.

type TLSConf

type TLSConf struct {
	ClientAuthType tls.ClientAuthType
	ServerCert     []byte
	ServerKey      []byte
	RootCerts      [][]byte
	// contains filtered or unexported fields
}

TLSConf represents a TLS configuration.

func NewTLSConf

func NewTLSConf() *TLSConf

NewTLSConf returns a new TLS configuration.

func (*TLSConf) IsTLSEnabled

func (config *TLSConf) IsTLSEnabled() bool

IsEnabled returns true if the TLS is enabled.

func (*TLSConf) SetClientAuthType

func (config *TLSConf) SetClientAuthType(authType tls.ClientAuthType)

SetClientAuthType sets a client authentication type.

func (*TLSConf) SetRootCertFiles

func (config *TLSConf) SetRootCertFiles(files ...string) error

SetRootCertFile sets a SSL root certificates.

func (*TLSConf) SetRootCerts

func (config *TLSConf) SetRootCerts(certs ...[]byte)

SetRootCerts sets a SSL root certificates.

func (*TLSConf) SetServerCert

func (config *TLSConf) SetServerCert(cert []byte)

SetServerCert sets a SSL server certificate.

func (*TLSConf) SetServerCertFile

func (config *TLSConf) SetServerCertFile(file string) error

SetServerCertFile sets a SSL server certificate file.

func (*TLSConf) SetServerKey

func (config *TLSConf) SetServerKey(key []byte)

SetServerKey sets a SSL server key.

func (*TLSConf) SetServerKeyFile

func (config *TLSConf) SetServerKeyFile(file string) error

SetServerKeyFile sets a SSL server key file.

func (*TLSConf) SetTLSConfig

func (config *TLSConf) SetTLSConfig(tlsConfig *tls.Config)

SetTLSConfig sets a TLS configuration.

func (*TLSConf) SetTLSEnabled

func (config *TLSConf) SetTLSEnabled(enabled bool)

SetTLSEnabled sets a TLS enabled flag.

func (*TLSConf) TLSConfig

func (config *TLSConf) TLSConfig() (*tls.Config, error)

TLSConfig returns a TLS configuration from the configuration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL