db

package
v0.0.0-...-ff36db3 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Db *gorm.DB

Db .

Functions

func Connection

func Connection() error

Init .

Types

type Bucket

type Bucket struct {
	Model
	AccessKey string
	SecretKey string
	Name      string
	UserID    int
	Host      string
}

func (*Bucket) Query

func (b *Bucket) Query() error

Query .

func (Bucket) TableName

func (Bucket) TableName() string

type DbConfig

type DbConfig struct {
	Host     string
	User     string
	Password string
	Name     string
	Port     int
	Charset  string
}

DbConfig .

type Metadata

type Metadata struct {
	Model
	Name      string `gorm:"index"`
	Type      string
	Size      int64
	Hash      string `gorm:"index"`
	StoreNode string
	StorePath string
	Usable    bool `gorm:"index"` //节点是否可用.
	BucketID  int  `gorm:"index"`
}

Metadata 元数据.

func (*Metadata) Create

func (m *Metadata) Create() error

Create 创建.

func (*Metadata) QueryNodeIP

func (m *Metadata) QueryNodeIP() (list []string, err error)

Query.

func (Metadata) TableName

func (Metadata) TableName() string

TableName .

type Model

type Model struct {
	ID         int       `gorm:"primary_key" json:"id"`
	CreatedAt  time.Time `gorm:"created_at"`
	UpdatedAt  time.Time `gorm:"created_at"`
	CreateTime string    `gorm:"-"`
	UpdateTime string    `gorm:"-"`
}

Model .

type User

type User struct {
	Model
	Name     string
	Account  string
	Password string
}

func (User) TableName

func (User) TableName() string

TableName.

Jump to

Keyboard shortcuts

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