sql

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SqlConfig added in v0.1.0

type SqlConfig struct {
	Host     string `toml:"host"`
	Port     int    `toml:"port"`
	User     string `toml:"user"`
	Password string `toml:"password"`
	Database string `toml:"db"`
	MaxConns int    `toml:"max_conns"`
	MinConns int    `toml:"min_conns"`
}

type SqlPlugin

type SqlPlugin struct {
	gorgo.BasePlugin
	// contains filtered or unexported fields
}

func NewSqlPlugin

func NewSqlPlugin() *SqlPlugin

func (*SqlPlugin) CanHotReload added in v0.1.0

func (p *SqlPlugin) CanHotReload() bool

HotReloadable implementation

func (*SqlPlugin) GetConfig added in v0.1.0

func (p *SqlPlugin) GetConfig() SqlConfig

func (*SqlPlugin) GetDefaultConfig added in v0.1.0

func (p *SqlPlugin) GetDefaultConfig() map[string]interface{}

func (*SqlPlugin) GetEventSubscriptions added in v0.1.0

func (p *SqlPlugin) GetEventSubscriptions() map[string]gorgo.EventHandler

EventSubscriber implementation

func (*SqlPlugin) GetMiddleware added in v0.1.0

func (p *SqlPlugin) GetMiddleware() []gorgo.MiddlewareFunc

MiddlewareProvider implementation

func (*SqlPlugin) GetPool

func (p *SqlPlugin) GetPool() *pgxpool.Pool

Additional methods for database operations

func (*SqlPlugin) GetServices added in v0.1.0

func (p *SqlPlugin) GetServices() map[string]interface{}

ServiceProvider implementation

func (*SqlPlugin) Initialize

func (p *SqlPlugin) Initialize(container *container.Container, config map[string]interface{}) error

Main plugin methods

func (*SqlPlugin) OnAfterInit added in v0.1.0

func (p *SqlPlugin) OnAfterInit(ctx context.Context) error

func (*SqlPlugin) OnAfterStart added in v0.1.0

func (p *SqlPlugin) OnAfterStart(ctx context.Context) error

func (*SqlPlugin) OnAfterStop added in v0.1.0

func (p *SqlPlugin) OnAfterStop(ctx context.Context) error

func (*SqlPlugin) OnBeforeInit added in v0.1.0

func (p *SqlPlugin) OnBeforeInit(ctx context.Context) error

LifecycleHooks implementation

func (*SqlPlugin) OnBeforeStart added in v0.1.0

func (p *SqlPlugin) OnBeforeStart(ctx context.Context) error

func (*SqlPlugin) OnBeforeStop added in v0.1.0

func (p *SqlPlugin) OnBeforeStop(ctx context.Context) error

func (*SqlPlugin) OnHotReload added in v0.1.0

func (p *SqlPlugin) OnHotReload(newConfig map[string]interface{}) error

func (*SqlPlugin) Start added in v0.1.0

func (p *SqlPlugin) Start(ctx context.Context) error

func (*SqlPlugin) Stop added in v0.1.0

func (p *SqlPlugin) Stop(ctx context.Context) error

func (*SqlPlugin) TransactionMiddleware added in v0.1.0

func (p *SqlPlugin) TransactionMiddleware() gorgo.MiddlewareFunc

Middleware for automatic transaction management

func (*SqlPlugin) ValidateConfig added in v0.1.0

func (p *SqlPlugin) ValidateConfig(config map[string]interface{}) error

ConfigurablePlugin implementation

Jump to

Keyboard shortcuts

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