simpleuploader

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: MIT Imports: 14 Imported by: 0

README

Simple Uploader for Go

Library provides simple file upload interface to S3, FTP and sFTP servers.

Features

  • Auto-retry if upload went wrong
  • Auto-generation public url for uploaded file
  • Auto-create directory path on ftp/sftp servers

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FTPUploader

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

func (*FTPUploader) Upload

func (uploader *FTPUploader) Upload(file *os.File, name string) (string, error)

type S3Uploader

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

func (*S3Uploader) Upload

func (uploader *S3Uploader) Upload(file *os.File, name string) (string, error)

type SFTPUploader

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

func (*SFTPUploader) Upload

func (uploader *SFTPUploader) Upload(file *os.File, name string) (string, error)

type Uploader

type Uploader interface {
	// Upload загружает файл по указанному имени
	Upload(file *os.File, name string) (string, error)
}

func NewFTP

func NewFTP(addr string, login string, password string, dir string, pathPrefix string, urlPrefix string) Uploader

NewFTP создает настроенный FTPUploader(s) uploader

func NewS3

func NewS3(config *aws.Config, bucket string, dir string, pathPrefix string, urlPrefix string) Uploader

NewS3 создает настроенный S3Uploader uploader

func NewSFTP

func NewSFTP(addr string, login string, password string, dir string, pathPrefix string, urlPrefix string) Uploader

NewSFTP создает настроенный SFTPUploader(s) uploader

Jump to

Keyboard shortcuts

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