storage

package
v0.0.0-...-10b8954 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EmptyModel = &model.Zblob{
		Title:        "Empty",
		Description:  "empty petriNet Model",
		Keywords:     "empty",
		Base64Zipped: emptyModel,
		IpfsCid:      emptyModelCid,
	}

	EmptySnippet = &model.Zblob{
		Title:        "Empty",
		Description:  "empty js Snippet",
		Keywords:     "empty",
		Base64Zipped: emptySnippet,
		IpfsCid:      emptySnippetCid,
	}
)

Functions

func ConnectDb

func ConnectDb(dbPath string) *sql.DB

func CreateBlobTable

func CreateBlobTable(db *sql.DB, tableName string)

func CreateTables

func CreateTables(db *sql.DB)

func ResetDb

func ResetDb(dbpath string, dropTables ...bool) *sql.DB

Types

type ModelTable

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

func NewModelTable

func NewModelTable(db *sql.DB) ModelTable

func (ModelTable) Create

func (m ModelTable) Create(ipfsCid, base64Zipped, title, description, keywords, referrer string) (int64, error)

func (ModelTable) Get

func (m ModelTable) Get(id int64) *model.Zblob

func (ModelTable) GetByCid

func (m ModelTable) GetByCid(cid string) *model.Zblob

func (ModelTable) GetMaxId

func (m ModelTable) GetMaxId() int64

type SnippetTable

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

func NewSnippetTable

func NewSnippetTable(db *sql.DB) SnippetTable

func (SnippetTable) Create

func (m SnippetTable) Create(ipfsCid, base64Zipped, title, description, keywords, referrer string) (int64, error)

func (SnippetTable) Get

func (m SnippetTable) Get(id int64) *model.Zblob

func (SnippetTable) GetByCid

func (m SnippetTable) GetByCid(cid string) *model.Zblob

func (SnippetTable) GetMaxId

func (m SnippetTable) GetMaxId() int64

type Storage

type Storage struct {
	Model   server.BlobAccessor
	Snippet server.BlobAccessor
	// contains filtered or unexported fields
}

func New

func New(db *sql.DB) *Storage

Jump to

Keyboard shortcuts

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