storage

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFoundID = errors.New("db: could not find ID")
)

Functions

This section is empty.

Types

type DB

type DB struct {
	DriverName     string
	DataSourceName string
}

func (DB) InitDB

func (dbInfo DB) InitDB() error

func (DB) PasteAdd

func (dbInfo DB) PasteAdd(paste Paste) (string, error)

func (DB) PasteDelete

func (dbInfo DB) PasteDelete(id string) error

func (DB) PasteDeleteExpired

func (dbInfo DB) PasteDeleteExpired() (int64, error)

func (DB) PasteGet

func (dbInfo DB) PasteGet(id string) (Paste, error)

type Paste

type Paste struct {
	ID         string `json:"id"` // Ignored when creating
	Title      string `json:"title"`
	Body       string `json:"body"`
	CreateTime int64  `json:"createTime"` // Ignored when creating
	DeleteTime int64  `json:"deleteTime"`
	OneUse     bool   `json:"oneUse"`
	Syntax     string `json:"syntax"`

	Author      string `json:"author"`
	AuthorEmail string `json:"authorEmail"`
	AuthorURL   string `json:"authorURL"`
}

Jump to

Keyboard shortcuts

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