database

package
v0.0.0-...-6e73f26 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeSchema

func InitializeSchema(dbPath string) error

Types

type Database

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

func NewDatabase

func NewDatabase(dbPath string) (*Database, error)

func (*Database) Close

func (db *Database) Close() error

func (*Database) CreateSnippet

func (db *Database) CreateSnippet(snippet Snippet) (int64, error)

func (*Database) GetAllSnippets

func (db *Database) GetAllSnippets(snippets *[]Snippet) error

func (*Database) GetSnippetByID

func (db *Database) GetSnippetByID(id int) (Snippet, error)

func (*Database) SearchSnippets

func (db *Database) SearchSnippets(keyword string) ([]Snippet, error)

func (*Database) UpdateSnippet

func (db *Database) UpdateSnippet(id int, snippet Snippet) error

type Snippet

type Snippet struct {
	ID          int
	Title       string
	Description string
	Tags        string
	Code        string
	Language    string
}

Jump to

Keyboard shortcuts

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