tkserver

package
v0.0.0-...-ee9d8c9 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const SERVER_START_LINE = "--TAKI SERVER START--"

Line that is printed prior to switching to binary encoding

View Source
const TAKI_SERVER_CLASS = "TakiServer"

Variables

View Source
var ErrTaskNotExist = errors.New("task does not exist")

Error returned by task APIs when the task isn't found

View Source
var ErrTaskNotProgressive = errors.New("task does not implement Progressive")

Error when a task does not implement the Progressive interface

View Source
var ErrTaskNotStarted = errors.New("task not started")

Indicates that a task has not started

Functions

func GetInode

func GetInode(path string) (uint, error)

Types

type CollectFilesRes

type CollectFilesRes struct {
	// Number of bytes collected
	Bytes int64
	// Total number of bytes to collect
	Total int
	// Is the task fully complete
	Done bool
}

type Empty

type Empty struct{}

type GenerateDiffReq

type GenerateDiffReq struct {
	Base *fsdiff.DirMeta
}

type GetRootsRes

type GetRootsRes struct {
	Roots []string
}

type ServerConfig

type ServerConfig struct {
	// Root path to collect and diff from
	Root string
	// List of exclusions (relative to root)
	Exclude []string
	// Output path for CollectFiles
	Output string
}

type TakiServer

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

func (*TakiServer) GenerateDiff

func (s *TakiServer) GenerateDiff(req *GenerateDiffReq, res *Empty) (err error)

func (*TakiServer) GetRoots

func (s *TakiServer) GetRoots(req Empty, res *GetRootsRes) (err error)

func (*TakiServer) SetConfig

func (s *TakiServer) SetConfig(config *ServerConfig, res *bool) error

func (*TakiServer) TarProgress

func (s *TakiServer) TarProgress(req Empty, res *float64) error

Get the progress of the tar task

func (*TakiServer) TarStart

func (s *TakiServer) TarStart(req Empty, res *Empty) error

Start collecting files into an archive

type TarTask

type TarTask struct {
	*task.BaseTask
	// Ouput tar file path
	Output string
	// Root of tar file contents
	Root string
	// List of file paths to collect (relative to Root)
	Files []string
	// Size of each file
	FileSizes []int64
	// contains filtered or unexported fields
}

func (*TarTask) GetCurrentBytes

func (tt *TarTask) GetCurrentBytes() int64

func (*TarTask) GetProgress

func (tt *TarTask) GetProgress() float64

func (*TarTask) Run

func (tt *TarTask) Run(ctx context.Context) task.Void

type TaskCopy

type TaskCopy struct {
	*task.BaseTask
	// contains filtered or unexported fields
}

func NewTaskCopy

func NewTaskCopy(src io.ReadSeekCloser, dst io.WriteCloser) *TaskCopy

func (*TaskCopy) GetProgress

func (t *TaskCopy) GetProgress() float64

func (*TaskCopy) Start

func (t *TaskCopy) Start() task.Void

Jump to

Keyboard shortcuts

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