app_db

package
v0.0.0-...-a44c12d Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *sql.DB
View Source
var TRUSTED_IPFS_GATEWAYS = []IPFSGateway{
	{Name: "deronfts.com", Endpoint: "https://ipfs.deronfts.com/ipfs/{cid}"},
	{Name: "ipfs.io", Endpoint: "https://ipfs.io/ipfs/{cid}"},
	{Name: "pinata.cloud", Endpoint: "https://gateway.pinata.cloud/ipfs/{cid}"},
	{Name: "dweb.link", Endpoint: "https://dweb.link/ipfs/{cid}"},
	{Name: "nftstorage.link", Endpoint: "https://{cid}.ipfs.nftstorage.link"},
}

Functions

func ClearNodeConnections

func ClearNodeConnections() error

func DelIPFSGateway

func DelIPFSGateway(id int64) error

func DelNodeConnection

func DelNodeConnection(id int64) error

func DelWalletInfo

func DelWalletInfo(addr string) error

func GetNodeCount

func GetNodeCount() (int, error)

func InsertIPFSGateway

func InsertIPFSGateway(gateway IPFSGateway) error

func InsertNodeConnection

func InsertNodeConnection(node NodeConnection) error

func InsertWalletInfo

func InsertWalletInfo(walletInfo WalletInfo) error

func Load

func Load() error

func ReOrderIPFSGateways

func ReOrderIPFSGateways(db *sql.DB) error

func ReOrderNodes

func ReOrderNodes(db *sql.DB) error

func ResetIPFSGateways

func ResetIPFSGateways() error

func ResetNodeConnections

func ResetNodeConnections() error

func UpdateIPFSGateway

func UpdateIPFSGateway(gateway IPFSGateway) error

func UpdateNodeConnection

func UpdateNodeConnection(node NodeConnection) error

func UpdateWalletInfo

func UpdateWalletInfo(walletInfo WalletInfo) error

Types

type GetIPFSGatewaysParams

type GetIPFSGatewaysParams struct {
	Active sql.NullBool
}

type IPFSGateway

type IPFSGateway struct {
	ID           int64
	Name         string
	Endpoint     string
	FetchHeaders map[string]string
	Active       bool
	OrderNumber  int
}

func GetIPFSGateway

func GetIPFSGateway(id int64) (gateway IPFSGateway, err error)

func GetIPFSGateways

func GetIPFSGateways(params GetIPFSGatewaysParams) ([]IPFSGateway, error)

func (IPFSGateway) Fetch

func (i IPFSGateway) Fetch(cId string, timeout time.Duration) (*http.Response, error)

func (IPFSGateway) TestFetch

func (i IPFSGateway) TestFetch() error

type JsonWalletInfo

type JsonWalletInfo struct {
	Name              string `json:"name"`
	Addr              string `json:"addr"`
	RegistrationTxHex string `json:"registration_tx_hex"`
	Timestamp         int64  `json:"timestamp"`
}

type NodeConnection

type NodeConnection struct {
	ID          int64
	Endpoint    string
	Name        string
	Integrated  bool
	OrderNumber int
}

func GetIntegratedNode

func GetIntegratedNode() NodeConnection

func GetLocalNode

func GetLocalNode() NodeConnection

func GetNodeConnection

func GetNodeConnection(id int64) (node NodeConnection, err error)

func GetNodeConnectionByEndpoint

func GetNodeConnectionByEndpoint(endpoint string) (node NodeConnection, err error)

func GetNodeConnections

func GetNodeConnections() ([]NodeConnection, error)

func GetTrustedRemoveNodes

func GetTrustedRemoveNodes() []NodeConnection

type WalletInfo

type WalletInfo struct {
	Addr              string
	Name              string
	RegistrationTxHex string
	Timestamp         int64
	OrderNumber       int
}

func GetWalletInfo

func GetWalletInfo(addr string) (WalletInfo, error)

func GetWallets

func GetWallets() ([]WalletInfo, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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