repo

package
v1.0.0-alpha5 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2023 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ScanToken

func ScanToken(scanner *bufio.Scanner) (string, bool)

Types

type Client

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

func NewClient

func NewClient(user, password string) *Client

func (*Client) CheckIfFileIsUpToDate

func (c *Client) CheckIfFileIsUpToDate(fileNameLocal, fileNameRemote, storagePath string) (bool, error)

func (*Client) Close

func (c *Client) Close()

func (*Client) Connect

func (c *Client) Connect(addr string) error

func (*Client) DownloadFile

func (c *Client) DownloadFile(fileNameRemote, fileNameLocal, storagePath string) (bool, error)

DownloadFile tries to download the file. If it returns `true, nil` then a new file has been downloaded. Otherwise there was either an error or the file hasn't changed.

func (*Client) UploadFile

func (c *Client) UploadFile(fileNameSrc, fileNameDst string) error

type ProgressWriter

type ProgressWriter struct {
	Total          int64
	ReportInterval int64
	Callback       func(total int64)
	// contains filtered or unexported fields
}

func (*ProgressWriter) Wrap

func (pw *ProgressWriter) Wrap(w io.Writer) io.Writer

func (*ProgressWriter) Write

func (pw *ProgressWriter) Write(p []byte) (n int, err error)

type Server

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

func NewServer

func NewServer(basePath string) *Server

func (*Server) AddAdmin

func (s *Server) AddAdmin(name, password string)

func (*Server) AddUser

func (s *Server) AddUser(name, password string)

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(addr string) error

Jump to

Keyboard shortcuts

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