models

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDefaultAdminExists

func CheckDefaultAdminExists(db *sql.DB) bool

func CheckDefaultExchangeExists

func CheckDefaultExchangeExists(db *sql.DB, name string) bool

func CreateDefaultAdmin

func CreateDefaultAdmin(db *sql.DB) error

func CreateDefaultAdminRoles

func CreateDefaultAdminRoles(db *sql.DB) error

func CreateDefaultExchanges

func CreateDefaultExchanges(db *sql.DB) error

func CreateDefaultRoles

func CreateDefaultRoles(db *sql.DB) error

func CreateExchangesTable

func CreateExchangesTable(db *sql.DB, driver string) error

func CreateRolesTable

func CreateRolesTable(db *sql.DB, driver string) error

func CreateUsersRolesTable

func CreateUsersRolesTable(db *sql.DB, driver string) error

func CreateUsersTable

func CreateUsersTable(db *sql.DB, driver string) error

Types

type Exchange

type Exchange struct {
	ID             int
	UserDefined    int
	Name           string
	AuthKey        string
	AuthPassphrase string
	AuthSecret     string
	Token          string
	Currency       string
}

func (*Exchange) CreateExchange

func (c *Exchange) CreateExchange(db *sql.DB) error

func (*Exchange) GetAllExchanges

func (c *Exchange) GetAllExchanges(db *sql.DB) ([]Exchange, error)

func (*Exchange) GetExchangeByName

func (c *Exchange) GetExchangeByName(db *sql.DB, name qsx.Name) error

type Role

type Role struct {
	ID   int
	Name string
}

func (*Role) CreateRole

func (r *Role) CreateRole(db *sql.DB) error

type User

type User struct {
	ID       uint32
	Username string
	Password string
	Salt     string
	Roles    []string
}

func (*User) CreateUser

func (u *User) CreateUser(db *sql.DB) error

func (*User) GetUserByUsername

func (u *User) GetUserByUsername(db *sql.DB, username string) error

func (*User) GetUsers

func (u *User) GetUsers(db *sql.DB) ([]*User, error)

type UserRole

type UserRole struct {
	UserID int
	RoleID int
}

func (*UserRole) CreateUserRole

func (ur *UserRole) CreateUserRole(db *sql.DB) error

Jump to

Keyboard shortcuts

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