database

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 3 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 NewDB

func NewDB(conn *sql.DB) (*DB, error)

func (*DB) Close

func (db *DB) Close()

func (*DB) GetAllFeeds

func (db *DB) GetAllFeeds() ([]FeedObject, error)

func (*DB) GetFeed

func (db *DB) GetFeed(txID string) (*FeedObject, error)

func (*DB) GetFeedsByUser

func (db *DB) GetFeedsByUser(address string) ([]FeedObject, error)

func (*DB) GetLastFeeds

func (db *DB) GetLastFeeds(limit int) ([]FeedObject, error)

func (*DB) SaveFeed

func (db *DB) SaveFeed(feed *FeedObject) error

type FeedObject

type FeedObject struct {
	TxID      string `json:"txID"`
	SubnetID  string `json:"subnetID"`
	ChainID   string `json:"chainID"`
	Address   string `json:"address"`
	Timestamp int64  `json:"timestamp"`
	Fee       uint64 `json:"fee"`
	Content   string `json:"content"` // JSON-encoded content
}

Jump to

Keyboard shortcuts

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