web

package
v0.0.0-...-cddd04e Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 License: ISC Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.

func FileServer

func FileServer(r chi.Router, path string, root http.FileSystem)

func StartHttpServer

func StartHttpServer(httpHost, httpPort string, charts *cache.Manager, db DataQuery,
	activeChain *chaincfg.Params, extDbFactory func(name string) (DataQuery, error))

func UseLogger

func UseLogger(logger slog.Logger)

UseLogger uses a specified Logger to output package logging info.

Types

type DataQuery

type DataQuery interface {
	ExchangeTickCount(ctx context.Context) (int64, error)
	AllExchangeTicks(ctx context.Context, currencyPair string, defaultInterval, offset, limit int) ([]ticks.TickDto, int64, error)
	AllExchange(ctx context.Context) (models.ExchangeSlice, error)
	FetchExchangeTicks(ctx context.Context, currencyPair, name string, defaultInterval, offset, limit int) ([]ticks.TickDto, int64, error)
	AllExchangeTicksCurrencyPair(ctx context.Context) ([]ticks.TickDtoCP, error)
	CurrencyPairByExchange(ctx context.Context, exchangeName string) ([]ticks.TickDtoCP, error)
	ExchangeTicksChartData(ctx context.Context, filter string, currencyPair string, selectedInterval int, exchanges string) ([]ticks.TickChartData, error)
	AllExchangeTicksInterval(ctx context.Context) ([]ticks.TickDtoInterval, error)
	TickIntervalsByExchangeAndPair(ctx context.Context, exchange string, currencyPair string) ([]ticks.TickDtoInterval, error)

	VspTickCount(ctx context.Context) (int64, error)
	FetchVSPs(ctx context.Context) ([]vsp.VSPDto, error)
	FilteredVSPTicks(ctx context.Context, vspName string, offset, limit int) ([]vsp.VSPTickDto, int64, error)
	AllVSPTicks(ctx context.Context, offset, limit int) ([]vsp.VSPTickDto, int64, error)

	PowCount(ctx context.Context) (int64, error)
	FetchPowData(ctx context.Context, offset, limit int) ([]pow.PowDataDto, int64, error)
	FetchPowDataBySource(ctx context.Context, source string, offset, limit int) ([]pow.PowDataDto, int64, error)
	FetchPowSourceData(ctx context.Context) ([]pow.PowDataSource, error)
	FetchPowChartData(ctx context.Context, pool string, dataType string) ([]pow.PowChartData, error)
	GetPowDistinctDates(ctx context.Context, vsps []string) ([]time.Time, error)

	MempoolCount(ctx context.Context) (int64, error)
	Mempools(ctx context.Context, offtset int, limit int) ([]mempool.Dto, error)

	BlockCount(ctx context.Context) (int64, error)
	Blocks(ctx context.Context, offset int, limit int) ([]mempool.BlockDto, error)
	BlocksWithoutVotes(ctx context.Context, offset int, limit int) ([]mempool.BlockDto, error)

	Votes(ctx context.Context, offset int, limit int) ([]mempool.VoteDto, error)
	VotesByBlock(ctx context.Context, blockHash string) ([]mempool.VoteDto, error)
	VotesCount(ctx context.Context) (int64, error)

	CountRedditStat(ctx context.Context, subreddit string) (int64, error)
	RedditStats(ctx context.Context, subreddit string, offset int, limit int) ([]commstats.Reddit, error)
	CountTwitterStat(ctx context.Context, handle string) (int64, error)
	TwitterStats(ctx context.Context, handle string, offset int, limit int) ([]commstats.Twitter, error)
	CountYoutubeStat(ctx context.Context, channel string) (int64, error)
	YoutubeStat(ctx context.Context, channel string, offset int, limit int) ([]commstats.Youtube, error)
	CountGithubStat(ctx context.Context, repository string) (int64, error)
	GithubStat(ctx context.Context, repository string, offset int, limit int) ([]commstats.Github, error)
	CommunityChart(ctx context.Context, platform string, dataType string, filters map[string]string) ([]commstats.ChartData, error)

	Snapshots(ctx context.Context, offset, limit int, forChart bool) ([]netsnapshot.SnapShot, int64, error)
	SnapshotCount(ctx context.Context) (int64, error)
	LastSnapshotTime(ctx context.Context) (timestamp int64)
	FindNetworkSnapshot(ctx context.Context, timestamp int64) (*netsnapshot.SnapShot, error)
	PreviousSnapshot(ctx context.Context, timestamp int64) (*netsnapshot.SnapShot, error)
	NextSnapshot(ctx context.Context, timestamp int64) (*netsnapshot.SnapShot, error)
	TotalPeerCount(ctx context.Context, timestamp int64) (int64, error)
	SeenNodesByTimestamp(ctx context.Context) ([]netsnapshot.NodeCount, error)
	NetworkPeers(ctx context.Context, timestamp int64, q string, offset int, limit int) ([]netsnapshot.NetworkPeer, int64, error)
	NetworkPeer(ctx context.Context, address string) (*netsnapshot.NetworkPeer, error)
	AverageLatency(ctx context.Context, address string) (int, error)
	PeerCountByUserAgents(ctx context.Context, sources string, offset, limit int) (userAgents []netsnapshot.UserAgentInfo, total int64, err error)
	PeerCountByIPVersion(ctx context.Context, timestamp int64, iPVersion int) (int64, error)
	PeerCountByCountries(ctx context.Context, sources string, offset, limit int) (countries []netsnapshot.CountryInfo, total int64, err error)
	GetIPLocation(ctx context.Context, ip string) (string, int, error)
	AllNodeVersions(ctx context.Context) ([]string, error)
	AllNodeContries(ctx context.Context) ([]string, error)
	FetchNodeLocations(ctx context.Context, offset, limit int) ([]netsnapshot.CountryInfo, int64, error)
	FetchNodeVersion(ctx context.Context, offset, limit int) ([]netsnapshot.UserAgentInfo, int64, error)
}

type Server

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

Jump to

Keyboard shortcuts

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