mysql

package
v0.0.0-...-a15424c Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SnippetModel

type SnippetModel struct {
	DB *sql.DB
}

func (*SnippetModel) Get

func (spp *SnippetModel) Get(id int) (*models.Snippet, error)

Get returns the snippet model instance with the given id

func (*SnippetModel) Insert

func (spp *SnippetModel) Insert(title, content, expires string) (int, error)

Insert inserts a new SnippetModel into the database

func (*SnippetModel) Lastest

func (spp *SnippetModel) Lastest() ([]*models.Snippet, error)

Return the 10 latest snippet from the database

Jump to

Keyboard shortcuts

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