tracker

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const MinTrackerInfoLength = 223

MinTrackerInfoLength = len(json.Marshal(TrackerInfo{}))

Variables

This section is empty.

Functions

This section is empty.

Types

type ShuntMiner

type ShuntMiner struct {
	Miners   []string `json:"miners"`
	Complete []bool   `json:"complete"`
}

type Track

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

func (*Track) AddToTraceFile

func (n *Track) AddToTraceFile(fid string, t TrackerInfo) error

func (*Track) DeleteTraceFile

func (n *Track) DeleteTraceFile(fid string)

func (*Track) HasTraceFile

func (n *Track) HasTraceFile(fid string) bool

func (*Track) ListTraceFiles

func (n *Track) ListTraceFiles() ([]string, error)

func (*Track) ParsingTraceFile

func (n *Track) ParsingTraceFile(fid string) (TrackerInfo, error)

type Tracker

type Tracker interface {
	AddToTraceFile(fid string, t TrackerInfo) error
	ParsingTraceFile(fid string) (TrackerInfo, error)
	HasTraceFile(fid string) bool
	ListTraceFiles() ([]string, error)
	DeleteTraceFile(fid string)
}

func NewTracker

func NewTracker(dir string) Tracker

type TrackerInfo

type TrackerInfo struct {
	Segment       []chain.SegmentDataInfo `json:"segment"`
	Owner         []byte                  `json:"owner"`
	ShuntMiner    []string                `json:"shunt_miner"`
	Points        coordinate.Range        `json:"range"`
	Fid           string                  `json:"fid"`
	FileName      string                  `json:"file_name"`
	BucketName    string                  `json:"bucket_name"`
	TerritoryName string                  `json:"territory_name"`
	CacheDir      string                  `json:"cache_dir"`
	Cipher        string                  `json:"cipher"`
	FileSize      uint64                  `json:"file_size"`
}

type TrackerInfov1

type TrackerInfov1 struct {
	Segment       []chain.SegmentDataInfo `json:"segment"`
	Owner         []byte                  `json:"owner"`
	ShuntMiner    ShuntMiner              `json:"shunt_miner"`
	Points        coordinate.Range        `json:"range"`
	Fid           string                  `json:"fid"`
	FileName      string                  `json:"file_name"`
	BucketName    string                  `json:"bucket_name"`
	TerritoryName string                  `json:"territory_name"`
	CacheDir      string                  `json:"cache_dir"`
	Cipher        string                  `json:"cipher"`
	FileSize      uint64                  `json:"file_size"`
	PutFlag       bool                    `json:"put_flag"`
}

Jump to

Keyboard shortcuts

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