storage

package module
v0.0.0-...-6efba7d Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: Apache-2.0 Imports: 18 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DEFAULT_CONFIG = Config{
	Host:         "localhost:9000",
	ID:           "minio",
	Secret:       "miniopass",
	Bucket:       "testcase",
	PublicBucket: "testcase-public",
	// contains filtered or unexported fields
}

Functions

This section is empty.

Types

type Client

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

func Connect

func Connect(config Config) (Client, error)

type Config

type Config struct {
	Host         string
	ID           string
	Secret       string
	Bucket       string
	PublicBucket string
	// contains filtered or unexported fields
}

func GetConfigFromEnv

func GetConfigFromEnv() Config

type FileInfo

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

type Info

type Info struct {
	Title     string
	TimeLimit float64
	Tests     []struct {
		Name   string
		Number int
	}
}

func ParseInfo

func ParseInfo(tomlPath string) (Info, error)

func (Info) TestCaseNames

func (info Info) TestCaseNames() []string

type Problem

type Problem struct {
	Name            string
	Version         string
	TestCaseVersion string
}

func (Problem) UploadPublicFile

func (p Problem) UploadPublicFile(ctx context.Context, c Client, localPath, key string) error

func (Problem) UploadPublicTestCase

func (p Problem) UploadPublicTestCase(ctx context.Context, c Client, localPath, key string) error

func (Problem) UploadTestCases

func (p Problem) UploadTestCases(ctx context.Context, c Client, tarGzPath string) error

type ProblemFiles

type ProblemFiles struct {
	TestCases   string
	PublicFiles string
}

func (ProblemFiles) CheckerPath

func (p ProblemFiles) CheckerPath() string

func (ProblemFiles) InFilePath

func (p ProblemFiles) InFilePath(testCase string) string

func (ProblemFiles) IncludeFilePaths

func (p ProblemFiles) IncludeFilePaths() ([]string, error)

func (ProblemFiles) InfoTomlPath

func (p ProblemFiles) InfoTomlPath() string

func (ProblemFiles) OutFilePath

func (p ProblemFiles) OutFilePath(testCase string) string

func (ProblemFiles) PublicFilePath

func (p ProblemFiles) PublicFilePath(key string) string

func (ProblemFiles) SolutionPath

func (p ProblemFiles) SolutionPath() string

func (ProblemFiles) VerifierPath

func (p ProblemFiles) VerifierPath() string

type TestCaseDownloader

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

func NewTestCaseDownloader

func NewTestCaseDownloader(client Client) (TestCaseDownloader, error)

func (TestCaseDownloader) Close

func (t TestCaseDownloader) Close() error

func (TestCaseDownloader) Fetch

func (t TestCaseDownloader) Fetch(problem Problem) (ProblemFiles, error)

type UploadTarget

type UploadTarget struct {
	Base    string
	Root    string
	Problem Problem
}

func NewUploadTarget

func NewUploadTarget(base, root string) (UploadTarget, error)

func (UploadTarget) BuildTestCaseTarGz

func (p UploadTarget) BuildTestCaseTarGz() (string, error)

func (UploadTarget) UploadPublicFiles

func (p UploadTarget) UploadPublicFiles(client Client) error

func (UploadTarget) UploadTestcases

func (p UploadTarget) UploadTestcases(client Client) error

Jump to

Keyboard shortcuts

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