db

package
v0.0.0-...-56940a3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Content

type Content struct {
	bun.BaseModel  `bun:"table:contents"`
	Id             string `bun:"id,pk"`
	Title          string `bun:"title"`
	Author         string `bun:"author"`
	Filepath       string `bun:"filepath"`
	RecipientLud16 string `bun:"recipient_lud16"`
	Price          int64  `bun:"price"`
}

type DB

type DB struct {
	*bun.DB
}

func NewDB

func NewDB(dataSourceName string) (*DB, error)

func (*DB) AddContent

func (d *DB) AddContent(content *Content) (string, error)

func (*DB) GetContent

func (d *DB) GetContent(id string) (*Content, error)

func (*DB) RemoveContent

func (d *DB) RemoveContent(id string) (string, error)

func (*DB) UpdateContent

func (d *DB) UpdateContent(content *Content) (string, error)

Jump to

Keyboard shortcuts

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