models

package
v0.0.0-...-243d353 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 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 Snippet

type Snippet struct {
	ID      int
	Title   string
	Content string
	Created time.Time
	Expires time.Time
}

type SnippetModel

type SnippetModel struct {
	DB *sql.DB
}

func (*SnippetModel) Get

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

func (*SnippetModel) Insert

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

func (*SnippetModel) Latest

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

Jump to

Keyboard shortcuts

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