upload

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUploadSize = errors.New("the template is larger than the maximum upload size supported by the service")

ErrUploadSize is the error returned when the template is too large to be uploaded to the image uploading service

View Source
var TemplateUploaders map[string]*TemplateUploader

TemplateUploaders is the list of registered template uploader implementations.

Functions

This section is empty.

Types

type ImgurUploader

type ImgurUploader struct{}

ImgurUploader allows the user to upload a template file anonymously to Imgur

func (ImgurUploader) Upload

func (iu ImgurUploader) Upload(templatePath string, templateName string, httpClient *http.Client) (string, error)

Upload a file to Imgur

func (ImgurUploader) UploaderDescription

func (iu ImgurUploader) UploaderDescription() string

UploaderDescription returns the description of the uploading service

func (ImgurUploader) UploaderID

func (iu ImgurUploader) UploaderID() string

UploaderID returns the ID of the uploading service

func (ImgurUploader) UploaderName

func (iu ImgurUploader) UploaderName() string

UploaderName returns the name of the uploading service

type ManualUploader

type ManualUploader struct{}

ManualUploader will not upload the template. The user will have to do it manually, then replace the image URL in the generated deck(s).

func (ManualUploader) Upload

func (mu ManualUploader) Upload(templatePath string, _templateName string, _client *http.Client) (string, error)

Upload just returns the template path, without uploading anything

func (ManualUploader) UploaderDescription

func (mu ManualUploader) UploaderDescription() string

UploaderDescription returns the description of the uploading service

func (ManualUploader) UploaderID

func (mu ManualUploader) UploaderID() string

UploaderID returns the ID of the uploading service

func (ManualUploader) UploaderName

func (mu ManualUploader) UploaderName() string

UploaderName returns the name of the uploading service

type TemplateUploader

type TemplateUploader interface {
	// Upload a file
	Upload(templatePath string, templateName string, httpClient *http.Client) (string, error)
	// UploaderID returns the ID of the uploading service
	UploaderID() string
	// UploaderName returns the name of the uploading service
	UploaderName() string
	// UploaderDescription returns the description of the uploading service
	UploaderDescription() string
}

TemplateUploader is a generic interface implemented by template image uploaders.

Jump to

Keyboard shortcuts

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