db

package
v0.0.0-...-46b96ff Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: Unlicense Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_ENV string = "postgres"

Variables

This section is empty.

Functions

func NewPostgresClient

func NewPostgresClient()

Types

type Article

type Article struct {
	ID          uint   `json:"id" gorm:"primary_key"`
	Title       string `json:"title"`
	Description string `json:"description"`
	Rate        int    `json:"rate"`
}

func CreateArticle

func CreateArticle(a *Article) (*Article, error)

func DeleteArticle

func DeleteArticle(id string) (*Article, error)

func ReadArticle

func ReadArticle(id string) (*Article, error)

func ReadArticles

func ReadArticles() ([]*Article, error)

func UpdateArticle

func UpdateArticle(article *Article) (*Article, error)

Jump to

Keyboard shortcuts

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