db

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mobile

type Mobile struct {
	Id        int64 `gorm:"primary_key"`
	Token     uuid.UUID
	ServerId  int64
	Server    *Server
	RequestId string
	CreatedAt time.Time
	UpdatedAt time.Time
}

func (*Mobile) TableName

func (m *Mobile) TableName() string

type Mobiles

type Mobiles struct {
	Db *gorm.DB
}

func (Mobiles) Add

func (n Mobiles) Add(mobile *Mobile) (id int64, err error)

func (Mobiles) GetById

func (n Mobiles) GetById(id int64) (mobile *Mobile, err error)

func (Mobiles) GetByToken

func (n Mobiles) GetByToken(token string) (mobile *Mobile, err error)

func (*Mobiles) List

func (n *Mobiles) List(limit, offset int64) (list []*Mobile, total int64, err error)

func (*Mobiles) Remove

func (n *Mobiles) Remove(mobileId int64) (err error)

func (*Mobiles) Update

func (n *Mobiles) Update(m *Mobile) (err error)

type Server

type Server struct {
	Id        int64 `gorm:"primary_key"`
	Token     string
	Mobiles   []*Mobile
	CreatedAt time.Time
	UpdatedAt time.Time
}

func (*Server) TableName

func (m *Server) TableName() string

type Servers

type Servers struct {
	Db *gorm.DB
}

func (Servers) Add

func (n Servers) Add(server *Server) (id int64, err error)

func (*Servers) DependencyLoading

func (n *Servers) DependencyLoading(server *Server) (err error)

func (Servers) GetById

func (n Servers) GetById(id int64) (server *Server, err error)

func (Servers) GetByToken

func (n Servers) GetByToken(token string) (server *Server, err error)

func (*Servers) List

func (n *Servers) List(limit, offset int64) (list []*Server, total int64, err error)

func (*Servers) Remove

func (n *Servers) Remove(serverId int64) (err error)

func (*Servers) Update

func (n *Servers) Update(m *Server) (err error)

type Variable

type Variable struct {
	Name      string `gorm:"primary_key"`
	Value     string
	Autoload  bool
	CreatedAt time.Time
	UpdatedAt time.Time
}

func (*Variable) TableName

func (d *Variable) TableName() string

type Variables

type Variables struct {
	Db *gorm.DB
}

func (Variables) Add

func (n Variables) Add(variable *Variable) (err error)

func (Variables) Delete

func (n Variables) Delete(name string) (err error)

func (Variables) GetAllEnabled

func (n Variables) GetAllEnabled() (list []*Variable, err error)

func (Variables) GetByName

func (n Variables) GetByName(name string) (variable *Variable, err error)

func (*Variables) List

func (n *Variables) List(limit, offset int64, orderBy, sort string) (list []*Variable, total int64, err error)

func (Variables) Update

func (n Variables) Update(m *Variable) (err error)

Jump to

Keyboard shortcuts

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