Documentation ¶
Index ¶
- func DirToTar(src string, buf io.Writer) error
- func Magnet(sender MagnetSender, fileList string, endpoint string, key string, debug bool)
- func SendFileHTTP(client *http.Client, endpoint string, filename string) (err error)
- func SendFileTCP(endpoint string, filename string) (err error)
- func UnfreezeEndpoint(endpoint string, key string, debug bool) (cEndpoint string)
- func UnfreezeList(files string, key string, debug bool) (fileList []string)
- func UploadHTTP(client *http.Client, url string, values map[string]io.Reader, filename string) (err error)
- type MagnetHTTPSender
- type MagnetSender
- type MagnetTCPSender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DirToTar ¶ added in v0.0.2
DirToTar: take a directory name as input and write the tar content of it in a buffer (~return tar content of a directory without writing archive on disk). Thanks to: https://gist.github.com/mimoo/25fc9716e0f1353791f5908f94d6e726
func Magnet ¶
func Magnet(sender MagnetSender, fileList string, endpoint string, key string, debug bool)
Magnet: wrapper functions to decrypt file list and endpoint and send all the files to the endpoint
func SendFileHTTP ¶ added in v0.0.2
SendFileHTTP: use HTTP multipart form data request to upload a specific file on specified endpoint
func SendFileTCP ¶ added in v0.0.2
func UnfreezeEndpoint ¶
UnfreezeEndpoint: Decrypt endpoint with xor function
func UnfreezeList ¶
UnfreezeList: unflat a file list and decrypt them using xor function. if debug mode is enabled, print some information
func UploadHTTP ¶ added in v0.0.2
func UploadHTTP(client *http.Client, url string, values map[string]io.Reader, filename string) (err error)
UploadHTTP: construct upload request and submit it. The filename is used for the directory case when we upload an tar gz archive (As it is passed as a buffer we can't access the filename)
Types ¶
type MagnetHTTPSender ¶ added in v0.0.2
MagnetHTTPSender: Sender that uses HTTP to send the files
func (MagnetHTTPSender) Name ¶ added in v0.0.2
func (sender MagnetHTTPSender) Name() string
type MagnetSender ¶ added in v0.0.2
type MagnetSender interface { //SendFiles: send file to target SendFiles(fileList []string, cEndpoint string, debug bool) //Name: return MagnetSender name Name() string }
func InitMagnetSender ¶ added in v0.0.2
func InitMagnetSender(method string) (sender MagnetSender)
InitMagnetSender: return MagnetSender struct regarding the method parameter
type MagnetTCPSender ¶ added in v0.0.2
type MagnetTCPSender struct { }
MagnetTCPSender: Sender that uses raw tcp to send the files
func (MagnetTCPSender) Name ¶ added in v0.0.2
func (sender MagnetTCPSender) Name() string