db

package
v3.4.25 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: GPL-3.0 Imports: 11 Imported by: 36

Documentation

Index

Constants

View Source
const ENV = "IOT_MASTER_DATABASE_"

Variables

View Source
var Engine *xorm.Engine

Functions

func Close

func Close() error

func Load added in v3.1.0

func Load() error

func Open

func Open() error

func SetOptions added in v3.1.0

func SetOptions(opts Options)

func Store added in v3.1.0

func Store() error

Types

type Options

type Options struct {
	Type     string `json:"type"`
	URL      string `json:"url"`
	Debug    bool   `json:"debug,omitempty"`
	LogLevel int    `json:"log_level"`
}

Options 参数

func Default

func Default() Options

func GetOptions added in v3.1.0

func GetOptions() Options

func (*Options) FromEnv added in v3.1.0

func (options *Options) FromEnv()

func (*Options) ToEnv added in v3.1.0

func (options *Options) ToEnv() []string

type Time added in v3.2.4

type Time time.Time

func (*Time) FromDB added in v3.2.4

func (t *Time) FromDB(b []byte) error

func (Time) MarshalJSON added in v3.2.4

func (t Time) MarshalJSON() ([]byte, error)

func (Time) MarshalText added in v3.2.4

func (t Time) MarshalText() ([]byte, error)

func (Time) Now added in v3.2.4

func (t Time) Now() Time

func (Time) ParseTime added in v3.2.4

func (t Time) ParseTime(tt time.Time) Time

func (Time) String added in v3.2.4

func (t Time) String() string

func (*Time) ToDB added in v3.2.4

func (t *Time) ToDB() ([]byte, error)

func (*Time) UnmarshalJSON added in v3.2.4

func (t *Time) UnmarshalJSON(b []byte) error

func (*Time) Value added in v3.2.4

func (t *Time) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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