surge

package
v0.0.0-...-a30bb73 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	All = iota
	Downloading
	Seeding
	Completed
	Paused
)

Variables

This section is empty.

Functions

func AddFileSeeder

func AddFileSeeder(fileHash string, addr string)

func AnySeeders

func AnySeeders(fileHash string) bool

func ByteCountSI

func ByteCountSI(b int64) string

ByteCountSI converts filesize in bytes to human readable text

func CloseDb

func CloseDb()

CloseDb .

func DbInsertFile

func DbInsertFile(File models.File)

Inserts a File to the DB

func DbReadSetting

func DbReadSetting(Name string) (string, error)

DbReadSetting Reads a key and returns value

func DbWriteSetting

func DbWriteSetting(Name string, value string) error

DbWriteSetting Stores or updates a key with a given value

func GetSeeders

func GetSeeders(fileHash string) []string

func InitializeDb

func InitializeDb()

InitializeDb initializes db

func InitializeFileSeedTracker

func InitializeFileSeedTracker()

func RemoveFileSeeder

func RemoveFileSeeder(fileHash string, addr string)

func RemoveSeeder

func RemoveSeeder(addr string)

func TopicEncode

func TopicEncode(topic string) string

TopicEncode .

Types

type Alert

type Alert struct {
	Name          string
	Symbol        string
	Interval      string
	Path          string //only for local
	NumChunks     int
	IsDownloading bool
	IsUploading   bool
	IsPaused      bool
	IsMissing     bool
	IsHashing     bool //only for local
	IsTracked     bool //only for local
	IsAvailable   bool //only for local
	ChunkMap      []byte
	ChunksShared  int
	Progress      float32 //only for remote
	Topic         string
	DateTimeAdded int64
}

type FileFilterState

type FileFilterState int

type PagedQueryRemoteResult

type PagedQueryRemoteResult struct {
	Result []models.FileListing
	Count  int
}

PagedQueryResult is a paging query result for file searches

type PagedQueryResult

type PagedQueryResult struct {
	Result []models.FileTransfer
	Count  int
}

PagedQueryResult is a paging query result for file searches

func SearchLocalFile

func SearchLocalFile(Query string, filterState FileFilterState, OrderBy string, IsDesc bool, Skip int, Take int) PagedQueryResult

SearchLocalFile runs a paged query

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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