db

package
v0.0.0-...-026e667 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect() (gorm.DB, error)

func CreateWebsite

func CreateWebsite(website Website, db gorm.DB)

Types

type Website

type Website struct {
	Name         string         `json:"name"`
	Id           string         `json:"id"`
	IconURL      string         `json:"icon_url"`
	Description  string         `json:"description"`
	Tags         pq.StringArray `json:"tags" gorm:"type:text[]"`
	Owner        int            `json:"owner"`
	Created      int            `json:"created"`
	LastBumped   int            `json:"last_bumped"`
	Bumps        int            `json:"bumps"`
	Upvotes      int            `json:"upvotes"`
	UpvotesToday int            `json:"upvotes_today"`
}

func GetWebsite

func GetWebsite(id string, db gorm.DB) (Website, bool)

Jump to

Keyboard shortcuts

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