database

package
v0.0.0-...-96504fd Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InitFunc

type InitFunc func(di zdi.Invoker) (*zdb.DB, error)

type Mode

type Mode struct {
	DelteColumn bool `json:"delete_column,omitempty"`
}

type Mysql

type Mysql struct {
	Host       string `json:"host"`
	User       string `json:"user"`
	Password   string `json:"password"`
	DBName     string `json:"db_name"`
	Parameters string `json:"parameters,omitempty"`
	Charset    string `json:"charset,omitempty"`
	Port       int    `json:"port"`
}

type Options

type Options struct {
	Sqlite   *Sqlite   `json:"sqlite,omitempty"`
	MySQL    *Mysql    `json:"mysql,omitempty"`
	Postgres *Postgres `json:"postgres,omitempty"`
	Mode     *Mode     `json:"mode,omitempty"`
	Driver   string    `json:"driver,omitempty"`
	// contains filtered or unexported fields
}

func (Options) ConfKey

func (Options) ConfKey() string

func (Options) DisableWrite

func (o Options) DisableWrite() bool

type Plugin

type Plugin struct {
	service.App
	// contains filtered or unexported fields
}

func New

func New(o ...Options) *Plugin

func (*Plugin) Controller

func (p *Plugin) Controller() []service.Controller

func (*Plugin) DB

func (p *Plugin) DB() (*zdb.DB, error)

func (*Plugin) Done

func (p *Plugin) Done(zdi.Invoker) error

func (*Plugin) Load

func (p *Plugin) Load(zdi.Invoker) (any, error)

func (*Plugin) Name

func (p *Plugin) Name() string

func (*Plugin) Reload

func (p *Plugin) Reload(conf *service.Conf) error

func (*Plugin) Start

func (p *Plugin) Start(zdi.Invoker) error

func (*Plugin) Tasks

func (p *Plugin) Tasks() []service.Task

type Postgres

type Postgres struct {
	Host     string `json:"host"`
	User     string `json:"user"`
	Password string `json:"password"`
	DBName   string `json:"db_name"`
	SSLMode  string `json:"ssl_mode"`
	Port     int    `json:"port"`
}

type Single

type Single struct {
	service.App
	// contains filtered or unexported fields
}

func NewSingle

func NewSingle(initDB InitFunc) *Single

func (*Single) Controller

func (p *Single) Controller() []service.Controller

func (*Single) DB

func (p *Single) DB() (*zdb.DB, error)

func (*Single) Done

func (p *Single) Done(zdi.Invoker) error

func (*Single) Load

func (p *Single) Load(di zdi.Invoker) (any, error)

func (*Single) Name

func (p *Single) Name() string

func (*Single) Start

func (p *Single) Start(zdi.Invoker) error

func (*Single) Tasks

func (p *Single) Tasks() []service.Task

type Sqlite

type Sqlite struct {
	Path       string `json:"path"`
	Parameters string `json:"parameters,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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