coin

package
v0.0.0-...-7fcd714 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: Unlicense Imports: 15 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetCoin

func SetCoin(s strapi.StrapiRestClient, coins, logos []string, src, slug string, get func(c *Coin, l *img.Logo))

func SetCoinsIndex

func SetCoinsIndex() func(c map[string]interface{}) interface{}
func BitNodeCoins(c nodes.NodeCoins, j *jdb.JDB) {
	log.Print("Start Process BitNodes Coins")
	nodeCoins := nodes.NodeCoins{N: 0}
	//c := GetAllCoins(j)

	for _, nodeCoin := range c.C {
		coin := getCoin(j, nodeCoin.Slug)
		log.Print("Bitnode Coin: ", coin.Name)
		bitNodes := nodes.BitNodes{}
		if err := cfg.CFG.Read("nodes", coin.Slug, &bitNodes); err != nil {
			log.Print("Error", err)
		}
		nodeCoins.N++
		nodeCoins.C = append(nodeCoins.C, nodes.NodeCoin{
			Rank:   coin.Rank,
			Name:   coin.Name,
			Ticker: coin.Ticker,
			Slug:   coin.Slug,
			Algo:   coin.Algo,
			Nodes:  bitNodes,
		})
		coin.BitNode = true
		j.Write("coins", "coin_"+coin.Slug, coin)
	}
	j.Write("info", "nodecoins", nodeCoins)
}

Types

type AlgoCoins

type AlgoCoins struct {
	N int         `json:"n"`
	C []CoinShort `json:"c"`
	A []string    `json:"a"`
}
type AlgoCoinsLogo struct {
	N int             `json:"n"`
	C []CoinShortLogo `json:"c"`
	A []string        `json:"a"`
}

type BitnodedCoins

type BitnodedCoins struct {
	N int            `json:"n"`
	C map[string]int `json:"c"`
}

type Blockchain

type Blockchain struct {
	GenesisDate          time.Time `json:"genesis"`
	NetworkHashrate      float64   `json:"hashrate"`
	MaxSupply            float64   `json:"supply"`
	TotalCoinsMined      float64   `json:"mined"`
	BlockHeight          int       `json:"block_height"`
	BlockTime            int       `json:"block_time"`
	Difficulty           float64   `json:"difficulty"`
	DifficultyAdjustment string    `json:"diffadj"`
	BlockReward          float64   `json:"block_rew"`
	BlockRewardReduction string    `json:"block_rewred"`
}

GeneralCoin stores identifying information about a coin in a database

type Coin

type Coin struct {
	Id                   int               `json:"id" form:"id"`
	Name                 string            `json:"name" form:"name"`
	Slug                 string            `json:"slug" form:"slug"`
	Description          string            `json:"description" form:"description"`
	Published            bool              `json:"published" form:"published"`
	Selected             bool              `json:"selected" form:"selected"`
	Favorite             bool              `json:"fav" form:"favorite"`
	Checked              map[string]bool   `json:"checked"`
	CreatedAt            time.Time         `json:"created"`
	UpdatedAt            time.Time         `json:"updated"`
	Order                int               `json:"order" form:"order"`
	SubDomain            bool              `json:"subdomain" form:"subdomain"`
	Symbol               string            `json:"symbol" form:"symbol"`
	Token                string            `json:"token" form:"token"`
	Algo                 string            `json:"algo" form:"algo"`
	Proof                string            `json:"proof" form:"proof"`
	Ico                  bool              `json:"ico" form:"ico"`
	BuiltOn              string            `json:"builton"`
	GenesisDate          time.Time         `json:"genesis"`
	NetworkHashrate      float64           `json:"hashrate"`
	MaxSupply            float64           `json:"supply"`
	TotalCoinsMined      float64           `json:"mined"`
	BlockHeight          int               `json:"blockheight"`
	BlockTime            int               `json:"blocktime"`
	Difficulty           float64           `json:"difficulty"`
	DifficultyAdjustment string            `json:"difficultyadjustment"`
	BlockReward          float64           `json:"blockreward"`
	BlockRewardReduction string            `json:"blockrewardreduction"`
	Rank                 int               `json:"rank" form:"rank"`
	Platform             string            `json:"platform" form:"platform"`
	BitNode              bool              `json:"bitnode" form:"bitnode"`
	SrcID                map[string]string `json:"srcid"`
}

func GetCoins

func GetCoins(s strapi.StrapiRestClient) (cc []*Coin)

func NewCoin

func NewCoin(slug string) (c *Coin)

func (*Coin) SetAlgo

func (c *Coin) SetAlgo(algo interface{})

func (*Coin) SetBitcoinTalk

func (c *Coin) SetBitcoinTalk(bitcointalk interface{})

func (*Coin) SetBlockHeight

func (c *Coin) SetBlockHeight(supply interface{})

func (*Coin) SetBlockReward

func (c *Coin) SetBlockReward(rew interface{})

func (*Coin) SetBlockRewardReduction

func (c *Coin) SetBlockRewardReduction(rew interface{})

func (*Coin) SetBlockTime

func (c *Coin) SetBlockTime(blockTime interface{})

func (*Coin) SetBuiltOn

func (c *Coin) SetBuiltOn(proof interface{})

func (*Coin) SetChat

func (c *Coin) SetChat(chat interface{})

func (*Coin) SetDescription

func (c *Coin) SetDescription(description interface{})

func (*Coin) SetDifficulty

func (c *Coin) SetDifficulty(diff interface{})

func (*Coin) SetDifficultyAdjustment

func (c *Coin) SetDifficultyAdjustment(diffadj interface{})

func (*Coin) SetExplorer

func (c *Coin) SetExplorer(explorer interface{})

func (*Coin) SetFacebook

func (c *Coin) SetFacebook(facebook interface{})

func (*Coin) SetGenesisDate

func (c *Coin) SetGenesisDate(start interface{})

func (*Coin) SetMaxSupply

func (c *Coin) SetMaxSupply(supply interface{})

func (*Coin) SetName

func (c *Coin) SetName(name interface{})

func (*Coin) SetNetworkHashrate

func (c *Coin) SetNetworkHashrate(supply interface{})

func (*Coin) SetProof

func (c *Coin) SetProof(proof interface{})

func (*Coin) SetReddit

func (c *Coin) SetReddit(reddit interface{})

func (*Coin) SetSrcID

func (c *Coin) SetSrcID(src, id string)

func (*Coin) SetSymbol

func (c *Coin) SetSymbol(ticker interface{})

func (*Coin) SetTelegram

func (c *Coin) SetTelegram(telegram interface{})

func (*Coin) SetTotalCoinsMined

func (c *Coin) SetTotalCoinsMined(supply interface{})

func (*Coin) SetTwitter

func (c *Coin) SetTwitter(twitter interface{})

func (*Coin) SetWebSite

func (c *Coin) SetWebSite(website interface{})

type CoinShort

type CoinShort struct {
	Rank   int    `json:"r"`
	Name   string `json:"n"`
	Symbol string `json:"y"`
	Slug   string `json:"s"`
	Algo   string `json:"a"`
}

Coin stores identifying information about coins in the database

type CoinShortLogo struct {
	Rank   int    `json:"r"`
	Name   string `json:"n"`
	Symbol string `json:"y"`
	Slug   string `json:"s"`
	Algo   string `json:"a"`
}

Coin stores identifying information about coins in the database

type CoinUser

type CoinUser struct {
	Id                   int       `json:"id" form:"id"`
	Name                 string    `json:"name" form:"name"`
	Slug                 string    `json:"slug" form:"slug"`
	Description          string    `json:"description" form:"description"`
	Selected             bool      `json:"selected" form:"selected"`
	Favorite             bool      `json:"fav" form:"favorite"`
	UpdatedAt            time.Time `json:"updated"`
	Order                int       `json:"order" form:"order"`
	Symbol               string    `json:"symbol" form:"symbol"`
	Token                string    `json:"token" form:"token"`
	Algo                 string    `json:"algo" form:"algo"`
	Proof                string    `json:"proof" form:"proof"`
	Ico                  bool      `json:"ico" form:"ico"`
	BuiltOn              string    `json:"builton"`
	GenesisDate          time.Time `json:"genesis"`
	NetworkHashrate      float64   `json:"hashrate"`
	MaxSupply            float64   `json:"supply"`
	TotalCoinsMined      float64   `json:"mined"`
	BlockHeight          int       `json:"blockheight"`
	BlockTime            int       `json:"blocktime"`
	Difficulty           float64   `json:"difficulty"`
	DifficultyAdjustment string    `json:"difficultyadjustment"`
	BlockReward          float64   `json:"blockreward"`
	BlockRewardReduction string    `json:"blockrewardreduction"`
	Rank                 int       `json:"rank" form:"rank"`
	Platform             string    `json:"platform" form:"platform"`
	BitNode              bool      `json:"bitnode" form:"bitnode"`
}

type Coins

type Coins struct {
	N int      `json:"n"`
	C []string `json:"c"`
}

type CoinsQueries

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

func Queries

func Queries(j *jdb.JDB, col string) *CoinsQueries

func (*CoinsQueries) CoinHandler

func (cq *CoinsQueries) CoinHandler(w http.ResponseWriter, r *http.Request)

CoinsHandler handles a request for coin data

func (*CoinsQueries) CoinNodesHandler

func (cq *CoinsQueries) CoinNodesHandler(w http.ResponseWriter, r *http.Request)

CoinNodesHandler handles a request for (?)

func (*CoinsQueries) CoinsHandler

func (cq *CoinsQueries) CoinsHandler(w http.ResponseWriter, r *http.Request)

CoinsHandler handles a request for coin data

func (*CoinsQueries) GetAlgoCoins

func (cq *CoinsQueries) GetAlgoCoins() AlgoCoins
func (cq *CoinsQueries) GetAlgoCoinsLogo() AlgoCoinsLogo

func (*CoinsQueries) GetAllCoins

func (cq *CoinsQueries) GetAllCoins() (c Coins)

func (*CoinsQueries) GetCoin

func (cq *CoinsQueries) GetCoin(slug string) (Coin, error)

func (*CoinsQueries) GetCoinShort

func (cq *CoinsQueries) GetCoinShort(slug string) (CoinShort, error)

func (*CoinsQueries) GetCoins

func (cq *CoinsQueries) GetCoins() Coins

func (*CoinsQueries) GetCoinsBin

func (cq *CoinsQueries) GetCoinsBin() Coins

func (*CoinsQueries) GetCoinsWords

func (cq *CoinsQueries) GetCoinsWords() (c Coins)
func (cq *CoinsQueries) GetLogo(coin string) (l string, err error)

func (*CoinsQueries) GetNodeCoins

func (cq *CoinsQueries) GetNodeCoins() (n Coins)

func (*CoinsQueries) GetRestCoins

func (cq *CoinsQueries) GetRestCoins() (c Coins)

func (*CoinsQueries) GetUsableCoins

func (cq *CoinsQueries) GetUsableCoins() Coins

func (*CoinsQueries) LogoHandler

func (cq *CoinsQueries) LogoHandler(w http.ResponseWriter, r *http.Request)

LogoHandler handles a request for logo data

func (*CoinsQueries) ProcessCoins

func (cq *CoinsQueries) ProcessCoins(s strapi.StrapiRestClient)

func (*CoinsQueries) SetCoin

func (cq *CoinsQueries) SetCoin(src, slug string, get func(c Coin))

func (*CoinsQueries) SetCoinsLogoIndex

func (cq *CoinsQueries) SetCoinsLogoIndex(s strapi.StrapiRestClient) func(c map[string]interface{}) interface{}

func (*CoinsQueries) WriteCoin

func (cq *CoinsQueries) WriteCoin(slug string, c interface{}) error

func (*CoinsQueries) WriteIndex

func (cq *CoinsQueries) WriteIndex(slug string, c interface{}) error

func (*CoinsQueries) WriteIndiceS

func (cq *CoinsQueries) WriteIndiceS(indices map[string]interface{}) error

func (*CoinsQueries) WriteInfo

func (cq *CoinsQueries) WriteInfo(slug string, c interface{}) error

func (*CoinsQueries) WriteInfoS

func (cq *CoinsQueries) WriteInfoS(infos map[string]interface{}) error
func (cq *CoinsQueries) WriteLogo(slug string, c interface{}) error

type CoinsShort

type CoinsShort struct {
	N int         `json:"n"`
	C []CoinShort `json:"c"`
}

type General

type General struct {
	Symbol string `json:"symbol" form:"symbol"`
	Token  string `json:"token" form:"token"`
	Algo   string `json:"algo" form:"algo"`
	Proof  string `json:"proof" form:"proof"`

	Ico     bool   `json:"ico" form:"ico"`
	BuiltOn string `json:"builton"`
}

GeneralCoin stores identifying information about a coin in a database

type Item

type Item struct {
	Name        string          `json:"name" form:"name"`
	Slug        string          `json:"slug" form:"slug"`
	Description string          `json:"description" form:"description"`
	Published   bool            `json:"published" form:"published"`
	Selected    bool            `json:"selected" form:"selected"`
	Favorite    bool            `json:"fav" form:"favorite"`
	Checked     map[string]bool `json:"checked"`
	CreatedAt   time.Time       `json:"created"`
	UpdatedAt   time.Time       `json:"updated"`
	Order       int             `json:"order" form:"order"`
}

General stores identifying information about item in the database

type JormCoins

type JormCoins interface {
	SetCoin(j *jdb.JDB, src, slug string, get func(c *Coin))
	SetName(name interface{})
	SetTicker(ticker interface{})
	SetAlgo(algo interface{})
	SetDescription(description interface{})
	SetProof(proof interface{})
	SetStart(start interface{})
	SetBitcoinTalk(bitcointalk interface{})
	SetTwitter(twitter interface{})
	SetReddit(reddit interface{})
	SetTelegram(telegram interface{})
	SetFacebook(facebook interface{})
	SetWebSite(website interface{})
	SetExplorer(explorer interface{})
	SetChat(chat interface{})
}
type Link struct {
	*Item
	URL string `json:"url"`
}

GeneralCoin stores identifying information about a coin in a database

type Links struct {
	WebSite     []Link `json:"web"`
	Explorer    []Link `json:"explorer"`
	Chat        []Link `json:"chat"`
	Twitter     Link   `json:"tw"`
	Facebook    Link   `json:"facebook"`
	Telegram    Link   `json:"telegram"`
	Reddit      Link   `json:"reddit"`
	Github      []Link `json:"github"`
	BitcoinTalk Link   `json:"bitcointalk"`
	WhitePaper  Link   `json:"whitepaper"`
}

GeneralCoin stores identifying information about a coin in a database

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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