db

package
v0.0.0-...-b743a0b Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() *sqlDB

Types

type DB

type DB interface {
	Open(string, string) error
	Close() error
	Create(interface{}, interface{}) error
}

func (*DB) Close

func (d *DB) Close() error

Close close the database

func (*DB) Create

func (d *DB) Create(schema, value interface{})

Create create a new table in the database

func (*DB) Search

func (d *DB) Search(value interface{}, args ...interface{})

Search search the content of a table

func (*DB) Update

func (d *DB) Update(value interface{}, attrs ...interface{})

Update update a table

type User

type User struct {
	gorm.Model
	Username string
	Hash     string
	Avatar   string
	Roles    []string
}

Jump to

Keyboard shortcuts

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