mysql

package
v0.0.0-...-5e8a461 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2022 License: MIT Imports: 3 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
}

Define a SnippetModel type which wraps a sql.DB connection pool.

func (*SnippetModel) Get

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

This will return a specific snippet based on its id.

func (*SnippetModel) Insert

func (m *SnippetModel) Insert(title, content, expires string) (int64, error)

This will insert a new snippet into the database.

func (*SnippetModel) Latest

func (m *SnippetModel) Latest() ([]*models.Snippet, error)

Jump to

Keyboard shortcuts

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