database

package
v0.0.0-...-350adb2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(pwd, name, host, user string)

Types

type BehaviorInfo

type BehaviorInfo struct {
	gorm.Model
	Name       string `gorm:"<-"`
	Dat        []byte `gorm:"<-"`
	UpdateTime int64  `gorm:"<-"`
}

type BotConfig

type BotConfig struct {
	gorm.Model

	Name string `gorm:"<-"`
	Addr string `gorm:"<-"` // bot driver address
}

type BotTemplateConfig

type BotTemplateConfig struct {
	gorm.Model

	Name string `gorm:"<-"`
	Tpl  []byte `gorm:"<-"`
}

type Database

type Database struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func Get

func Get() *Database

func (*Database) DelFile

func (f *Database) DelFile(name string) error

func (*Database) FindFile

func (f *Database) FindFile(name string) (BehaviorInfo, error)

func (*Database) GetAllFiles

func (f *Database) GetAllFiles() ([]BehaviorInfo, error)

func (*Database) UpsetFile

func (f *Database) UpsetFile(name string, byt []byte) error

Jump to

Keyboard shortcuts

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