store

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DevStore

type DevStore interface {

	// Check whether the developer exists
	DevExists(string) (bool, error)

	// Get all the developers in the database
	GetDevs() ([]model.User, error)

	// Get the number of developers in the database
	GetDevCount() (int, error)

	// Get the developer with the given username
	GetDevByUsername(string) (model.User, error)
}

DevStore is the repository for the generic user model.

func NewDevStore

func NewDevStore() DevStore

NewDevStore creates and returns a new dev store instance

type IconStore

type IconStore interface {

	// Gets all the icons in the database
	GetIcons() ([]model.Icon, error)

	// Gets all icons by the developer
	GetIconsByDev(string) ([]model.Icon, error)

	// Gets all the icons by the developer
	GetIconsByPackByDev(string, string) ([]model.Icon, error)

	// Gets icons with status = pending
	GetPendingIconsByPackByDev(string, string) ([]model.Icon, error)

	// Gets icons with status = done
	GetDoneIconsByPackByDev(string, string) ([]model.Icon, error)

	// Gets icons with component = given string
	GetIconByComponentByPackByDev(string, string, string) (*model.Icon, error)

	// Saves a single icon
	SaveIcon(string, *model.Icon) (int, error)

	// Saves an array of icons
	SaveIcons(string, []*model.Icon) (int, error)

	// Gets the number of icons
	GetIconCountByDev(string) (int, error)

	// Gets the number of pending icons
	GetPendingIconCountByDev(string) (int, error)

	// Gets the number of done icons
	GetDoneIconCountByDev(string) (int, error)

	// Updates the status of the icon with the given component with the given status
	UpdateIconStatus(string, string, string, string) (string, error)

	GetIconPackIDFromName(string, string) (int, error)
}

IconStore is the repository for the Icon model.

func NewIconStore

func NewIconStore() IconStore

NewIconStore creates and returns a new icon store instance

type PackStore

type PackStore interface {

	// Check whether givne pack exists
	PackExists(string, string) (bool, error)

	// Create new icon pack
	CreatePack(model.Pack) (string, error)

	// Gets all the icon packs in the database
	//!!!UNIMPLEMENTED
	GetPacks() ([]model.Pack, error)

	// Gets all the icon packs by the given dev
	GetPacksByDev(string) ([]model.Pack, error)

	// Gets the number of icon packs by the developer
	GetPackCountByDev(string) (int, error)
}

PackStore is the repository for the Icon Pack model (pack).

func NewPackStore

func NewPackStore() PackStore

NewPackStore creates and returns a new icon store instance

type PlanStore

type PlanStore interface {

	// Check whether the plans table exists
	PlansExists() (bool, error)

	// Create new plan
	CreatePlan(*model.Plan) (string, error)

	// Gets all the icon packs by the developer
	GetPlans() ([]model.Plan, error)
}

PlanStore is the repository for the plan model

func NewPlanStore

func NewPlanStore() PlanStore

NewPlanStore creates and returns a new plan store instance

type UserStore

type UserStore interface {

	// Gets the list of all users
	GetUsers() ([]model.User, error)
	// Creates a new user
	CreateUser(*model.User) (string, string, error)
}

UserStore is the repository for the generic user model.

func NewUserStore

func NewUserStore() UserStore

NewUserStore creates and returns a new user store instance

Jump to

Keyboard shortcuts

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