database

package
v0.0.0-...-9d7e9a8 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBClient

type DBClient struct {
	// contains filtered or unexported fields
}

DBClient is the database client type

func New

func New() (*DBClient, error)

New returns a new database client

func (*DBClient) CreatePack

func (dbc *DBClient) CreatePack(pack model.Pack) (string, error)

CreatePack creates a new icon pack record

func (*DBClient) CreatePlan

func (dbc *DBClient) CreatePlan(plan *model.Plan) (string, error)

CreatePlan creates a new plan record

func (*DBClient) CreateSchema

func (dbc *DBClient) CreateSchema() error

CreateSchema creates the required schema

func (*DBClient) CreateTables

func (dbc *DBClient) CreateTables() error

CreateTables creates the required tables

func (*DBClient) CreateUser

func (dbc *DBClient) CreateUser(user *model.User) (string, string, error)

CreateUser inserts a new user

func (*DBClient) DevExists

func (dbc *DBClient) DevExists(dev string) (bool, error)

DevExists checks whether the developer exists

func (*DBClient) GetDevByUsername

func (dbc *DBClient) GetDevByUsername(username string) (model.User, error)

GetDevByUsername gets the dev with the given username

func (*DBClient) GetDevCount

func (dbc *DBClient) GetDevCount() (int, error)

GetDevCount gets the number of all developers

func (*DBClient) GetDevs

func (dbc *DBClient) GetDevs() ([]model.User, error)

GetDevs gets all the icon packs

func (*DBClient) GetDoneIconCountByDev

func (dbc *DBClient) GetDoneIconCountByDev(dev string) (int, error)

GetDoneIconCountByDev returns the number of icon request in the database

func (*DBClient) GetDoneIconsByPackByDev

func (dbc *DBClient) GetDoneIconsByPackByDev(dev, pack string) ([]model.Icon, error)

GetDoneIconsByPackByDev retrieves the list of icons which are still pending

func (*DBClient) GetIconByComponentByPackByDev

func (dbc *DBClient) GetIconByComponentByPackByDev(dev, pack, component string) (*model.Icon, error)

GetIconByComponentByPackByDev returns the matching icon

func (*DBClient) GetIconCountByDev

func (dbc *DBClient) GetIconCountByDev(dev string) (int, error)

GetIconCountByDev returns the number of icon requests owned by the dev

func (*DBClient) GetIconPackIDFromName

func (dbc *DBClient) GetIconPackIDFromName(dev, pack string) (int, error)

GetIconPackIDFromName checks whether the plans table exists

func (*DBClient) GetIcons

func (dbc *DBClient) GetIcons() ([]model.Icon, error)

GetIcons gets all the icons in the DB

func (*DBClient) GetIconsByDev

func (dbc *DBClient) GetIconsByDev(dev string) ([]model.Icon, error)

GetIconsByDev gets all the icon packs by the dev

func (*DBClient) GetIconsByPackByDev

func (dbc *DBClient) GetIconsByPackByDev(dev, pack string) ([]model.Icon, error)

GetIconsByPackByDev gets all the icons by the developer

func (*DBClient) GetPackCountByDev

func (dbc *DBClient) GetPackCountByDev(dev string) (int, error)

GetPackCountByDev gets the number of icon packs by the dev

func (*DBClient) GetPacks

func (dbc *DBClient) GetPacks() ([]model.Pack, error)

GetPacks gets all the icon packs in the database

func (*DBClient) GetPacksByDev

func (dbc *DBClient) GetPacksByDev(dev string) ([]model.Pack, error)

GetPacksByDev gets all the icon packs

func (*DBClient) GetPendingIconCountByDev

func (dbc *DBClient) GetPendingIconCountByDev(dev string) (int, error)

GetPendingIconCountByDev returns the number of icon request in the database

func (*DBClient) GetPendingIconsByPackByDev

func (dbc *DBClient) GetPendingIconsByPackByDev(dev, pack string) ([]model.Icon, error)

GetPendingIconsByPackByDev retrieves the list of icons which are still pending

func (*DBClient) GetPlans

func (dbc *DBClient) GetPlans() ([]model.Plan, error)

GetPlans gets all the plans

func (*DBClient) GetUsers

func (dbc *DBClient) GetUsers() ([]model.User, error)

GetUsers gets the list of all users in the DB

func (*DBClient) PackExists

func (dbc *DBClient) PackExists(dev, pack string) (bool, error)

PackExists checks whether the icon pack exists

func (*DBClient) PlansExists

func (dbc *DBClient) PlansExists() (bool, error)

PlansExists checks whether the plans table exists

func (*DBClient) SaveIcon

func (dbc *DBClient) SaveIcon(dev string, icon *model.Icon) (int, error)

SaveIcon upserts the icon to the database and updates requester count on conflict !UNUSED

func (*DBClient) SaveIcons

func (dbc *DBClient) SaveIcons(dev string, icons []*model.Icon) (int, error)

SaveIcons upserts the list of icons to the database and updates requester counts on conflict

func (*DBClient) UpdateIconStatus

func (dbc *DBClient) UpdateIconStatus(dev, pack, component, status string) (string, error)

UpdateIconStatus updates the status of the icon request (pending | complete)

Jump to

Keyboard shortcuts

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