download

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const LOCALDIR = "./blocks/" // Local directory to store temp blocks files

Variables

This section is empty.

Functions

func Run

func Run(node *node.Node, ossEndpoint string) error

Run synchronize download from OSS to local node

Types

type DownloadKeeper

type DownloadKeeper struct {
	Node     *node.Node
	OssUrl   string
	FileUtil *util.FileUtil
}

DownloadKeeper the struct for download

func NewDownloadKeeper

func NewDownloadKeeper(node *node.Node, OssUrl string) (*DownloadKeeper, error)

NewDownloadKeeper return one new instance of DownloadKeeper

func (*DownloadKeeper) Download

func (d *DownloadKeeper) Download() error

Download get blocks from OSS and update the node

func (*DownloadKeeper) DownloadFiles

func (d *DownloadKeeper) DownloadFiles(start, end uint64, interval *util.Interval) error

DownloadFiles get block files from OSS, and update the node

func (*DownloadKeeper) GetInfoJson

func (d *DownloadKeeper) GetInfoJson() (*util.Info, error)

GetInfoJson Download info.json

func (*DownloadKeeper) GetObject

func (d *DownloadKeeper) GetObject(filename string) (*io.ReadCloser, error)

GetObject download the file object from OSS

func (*DownloadKeeper) GetObjectToFile

func (d *DownloadKeeper) GetObjectToFile(filename string) error

GetObjectToFile download the file object from OSS to local

func (*DownloadKeeper) SyncToNode

func (d *DownloadKeeper) SyncToNode(blocks []*types.Block) error

SyncToNode synchronize blocks to local node

Jump to

Keyboard shortcuts

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