Back to godoc.org

Package application

v1.2.5
Latest Go to latest

The highest tagged major version is .

Published: Jun 12, 2020 | License: GPL3 | Module: github.com/Z-M-Huang/Tools

Index

func AddApplicationUsage

func AddApplicationUsage(app *AppCard)

AddApplicationUsage add usage

func LoadSearchMappings

func LoadSearchMappings()

LoadSearchMappings load application search index

func ReloadAppList

func ReloadAppList()

ReloadAppList reload app list

type API

type API struct{}

API api endpoint

func (API) Dislike

func (API) Dislike(c *gin.Context)

Dislike /app/:name/dislike

func (API) Like

func (API) Like(c *gin.Context)

Like /app/:name/like

type AppCard

type AppCard struct {
	Name            string
	TemplateName    string
	ImageURL        string
	FontsAwesomeTag string
	Link            string
	Title           string
	Description     string
	Used            bool
	AmountUsed      uint64
	Liked           bool
	AmountLiked     uint64
}

AppCard used to render app card in pages

func GetApplicationsByName

func GetApplicationsByName(name string) *AppCard

GetApplicationsByName get application by name

func SearchAppListByNames

func SearchAppListByNames(name []string) []*AppCard

SearchAppListByNames get application by names

func SearchAppListByNamesWithLikes

func SearchAppListByNamesWithLikes(user *db.User, name []string) []*AppCard

SearchAppListByNamesWithLikes get application by names

type AppCategory

type AppCategory struct {
	Category string
	AppCards []*AppCard
}

AppCategory card list for single category

func GetAppList

func GetAppList() []*AppCategory

GetAppList get app list from redis

func GetAppListWithLiked

func GetAppListWithLiked(user *db.User) []*AppCategory

GetAppListWithLiked get application with liked populated

func GetAppListWithLikedWithoutPopular

func GetAppListWithLikedWithoutPopular(user *db.User) []*AppCategory

GetAppListWithLikedWithoutPopular get application with liked populated

func GetAppListWithoutPopular

func GetAppListWithoutPopular() []*AppCategory

GetAppListWithoutPopular this is mostly for search

type Page

type Page struct{}

Page logic

func (Page) RenderApplicationPage

func (Page) RenderApplicationPage(c *gin.Context)

RenderApplicationPage renders /app/:name

func (Page) SearchApps

func (Page) SearchApps(c *gin.Context)

SearchApps search apps in search bar

type SearchItem

type SearchItem struct {
	Name        string
	Title       string
	Description string
}

SearchItem in bleve

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier