database

package
v0.0.0-...-3963976 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

func Connect

func Connect() (DB, error)

func (DB) DeleteSnippet

func (db DB) DeleteSnippet(id string) error

func (DB) GetSnippet

func (db DB) GetSnippet(id string) (Snippet, error)

func (DB) GetSnippets

func (db DB) GetSnippets() ([]Snippet, error)

func (DB) UpsertSnippet

func (db DB) UpsertSnippet(snippet Snippet) error

type Snippet

type Snippet struct {
	ID       string `gorm:"primaryKey;type:varchar(255);uniqueIndex"`
	Language string `gorm:"type:varchar(255)"`
	Content  string `gorm:"type:text"`
	Created  int64  `gorm:"type:bigint"`
}

Jump to

Keyboard shortcuts

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