upload

package
v0.0.0-...-2369dea Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UploadTask

func UploadTask(taskDir string, uploader S3Uploader, sqlxDB *sqlx.DB) error

Types

type Problem

type Problem struct {
	Specification string   `toml:"specification"`
	Code          string   `toml:"code"`
	Name          string   `toml:"name"`
	Authors       []string `toml:"authors"`
	Tags          []string `toml:"tags"`
	Type          string   `toml:"type"`
	Time          float64  `toml:"time"`
	Memory        int      `toml:"memory"`
	Difficulty    int      `toml:"difficulty"`
}

type S3Uploader

type S3Uploader interface {
	Exists(key string) (bool, error)
	Upload(key string, content io.ReadSeeker) error // Change content type to io.Reader
}

type S3UploaderImpl

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

func NewS3Uploader

func NewS3Uploader(accessKey, secretKey, region, endpoint, bucket string) *S3UploaderImpl

func (*S3UploaderImpl) Exists

func (s *S3UploaderImpl) Exists(key string) (bool, error)

func (*S3UploaderImpl) Upload

func (s *S3UploaderImpl) Upload(key string, content io.ReadSeeker) error

Jump to

Keyboard shortcuts

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