utils

package
v0.0.0-...-20515da Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MagicBytes = []byte{'\x7F', 'E', 'L', 'F'}
)

Functions

func ConvertToTar

func ConvertToTar(files []TarFileBasicInfo) (*bytes.Buffer, error)

func DockerHostConfigBinds

func DockerHostConfigBinds(source, target string) string

func Exists

func Exists(path string) bool

func JudgeCaseDir

func JudgeCaseDir(tid uint32, version string) (string, error)

func JudgeFilePath

func JudgeFilePath(tid uint32, version, caseId, caseType string) (string, error)

func JudgeGenerateOutputDirWithMkdir

func JudgeGenerateOutputDirWithMkdir(baseDir string) (string, error)

func ReadFileBytes

func ReadFileBytes(absPath string) ([]byte, error)

func SubmissionBaseDir

func SubmissionBaseDir() (string, error)

func SubmissionGenerateDirWithMkdir

func SubmissionGenerateDirWithMkdir(sid uint32) (string, error)

func TouchFile

func TouchFile(path string) error

func TouchFileWithMagic

func TouchFileWithMagic(path string) error

Types

type TarFileBasicInfo

type TarFileBasicInfo struct {
	Name string
	Body []byte
	Mode int64
}

func AllFilesInDirToTarArchiveInfo

func AllFilesInDirToTarArchiveInfo(filePath, absPath string) ([]TarFileBasicInfo, error)

func TarToFile

func TarToFile(reader io.ReadCloser) ([]TarFileBasicInfo, error)

func TestCasesToTarArchiveInfo

func TestCasesToTarArchiveInfo(testCases []*JudgerModels.TestCaseType, absPath string) ([]TarFileBasicInfo, error)

Jump to

Keyboard shortcuts

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