database

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLst

func CreateLst(db *sqlx.DB, lst *Lst) error

func CreateLstEntity

func CreateLstEntity(db *sqlx.DB, entity *LstEntity) error

func CreateTables

func CreateTables(db *sqlx.DB)

func CreateUser

func CreateUser(db *sqlx.DB, usr *User) error

func CreateUserEntity

func CreateUserEntity(db *sqlx.DB, entity *UserEntity) error
func CreateUserLink(db *sqlx.DB, lnk *UserLink) error

func DelLst

func DelLst(db *sqlx.DB, lid uint64) error

func DelLstEntity

func DelLstEntity(db *sqlx.DB, id int) error

func DelUser

func DelUser(db *sqlx.DB, uid uint64) error

func DelUserEntity

func DelUserEntity(db *sqlx.DB, id uint32) error
func DelUserLink(db *sqlx.DB, id int32) error

func RecordUserPreviousName

func RecordUserPreviousName(db *sqlx.DB, uid uint64, name string, screenName string) error

func SetUserEntityLatestReleaseTime

func SetUserEntityLatestReleaseTime(db *sqlx.DB, id int, t time.Time) error

func UpdateLst

func UpdateLst(db *sqlx.DB, lst *Lst) error

func UpdateLstEntity

func UpdateLstEntity(db *sqlx.DB, entity *LstEntity) error

func UpdateUser

func UpdateUser(db *sqlx.DB, usr *User) error

func UpdateUserEntity

func UpdateUserEntity(db *sqlx.DB, entity *UserEntity) error
func UpdateUserLink(db *sqlx.DB, id int32, name string) error

Types

type Lst

type Lst struct {
	Id      uint64 `db:"id"`
	Name    string `db:"name"`
	OwnerId uint64 `db:"owner_uid"`
}

func GetLst

func GetLst(db *sqlx.DB, lid uint64) (*Lst, error)

type LstEntity

type LstEntity struct {
	Id        sql.NullInt32 `db:"id"`
	LstId     int64         `db:"lst_id"`
	Name      string        `db:"name"`
	ParentDir string        `db:"parent_dir"`
}

func GetLstEntity

func GetLstEntity(db *sqlx.DB, id int) (*LstEntity, error)

func LocateLstEntity

func LocateLstEntity(db *sqlx.DB, lid int64, parentDir string) (*LstEntity, error)

func (*LstEntity) Path

func (le *LstEntity) Path() string

type User

type User struct {
	Id           uint64 `db:"id"`
	ScreenName   string `db:"screen_name"`
	Name         string `db:"name"`
	IsProtected  bool   `db:"protected"`
	FriendsCount int    `db:"friends_count"`
}

func GetUserById

func GetUserById(db *sqlx.DB, uid uint64) (*User, error)

type UserEntity

type UserEntity struct {
	Id                sql.NullInt32 `db:"id"`
	Uid               uint64        `db:"user_id"`
	Name              string        `db:"name"`
	LatestReleaseTime sql.NullTime  `db:"latest_release_time"`
	ParentDir         string        `db:"parent_dir"`
}

func GetUserEntity

func GetUserEntity(db *sqlx.DB, id int) (*UserEntity, error)

func LocateUserEntity

func LocateUserEntity(db *sqlx.DB, uid uint64, parentDIr string) (*UserEntity, error)

func (*UserEntity) Path

func (ue *UserEntity) Path() string
type UserLink struct {
	Id                sql.NullInt32 `db:"id"`
	Uid               uint64        `db:"user_id"`
	Name              string        `db:"name"`
	ParentLstEntityId int32         `db:"parent_lst_entity_id"`
}
func GetUserLink(db *sqlx.DB, uid uint64, parentLstEntityId int32) (*UserLink, error)
func GetUserLinks(db *sqlx.DB, uid uint64) ([]*UserLink, error)

func (*UserLink) Path

func (ul *UserLink) Path(db *sqlx.DB) (string, error)

Jump to

Keyboard shortcuts

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