problems

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindInZip added in v0.0.3

func FindInZip(zipArchive *zip.ReadCloser, fileName string) (*io.ReadCloser, *zip.File, error)

搜索zip内的文件并打开(精确匹配)

func IsFileNotFoundError added in v0.0.3

func IsFileNotFoundError(e error) bool

func NewFileNotFoundError added in v0.0.3

func NewFileNotFoundError(fileName string) error

func PackProblems

func PackProblems(
	configuration *commonStructs.JudgeConfiguration,
	options *persistence.ProblemPackageOptions,
) error

执行题目数据表打包操作

func PackProblemsAsZip added in v0.0.3

func PackProblemsAsZip(options *persistence.ProblemPackageOptions) error

执行题目数据表打包操作(打包成zip版本)

func ReadProblemGPGInfo

func ReadProblemGPGInfo(problemFile string) (string, error)

读取题目携带的GPG信息

func ReadProblemGPGInfoZip added in v0.0.3

func ReadProblemGPGInfoZip(problemFile string) (string, error)

读取题目携带的GPG信息(ZIP)

func ReadProblemInfo

func ReadProblemInfo(problemFile string, unpack, validate bool, workDir string) (*commonStructs.JudgeConfiguration, string, error)

读取题目信息

func ReadProblemInfoZip added in v0.0.3

func ReadProblemInfoZip(problemFile string, unpack, validate bool, workDir string) (*commonStructs.JudgeConfiguration, string, error)

读取题目信息(ZIP) workDir只在需要解压的时候才会用到

func UnZip added in v0.0.3

func UnZip(zipArchive *zip.ReadCloser, destDir string) error

func WalkZip added in v0.0.3

func WalkZip(zipArchive *zip.ReadCloser, walkFunc func(file *zip.File) error) error

Types

type FileNotFoundError added in v0.0.3

type FileNotFoundError struct {
	FileName string
}

func (FileNotFoundError) Error added in v0.0.3

func (e FileNotFoundError) Error() string

type ProblemPackage

type ProblemPackage struct {
	Version         uint16 // (VER) Package Version
	CommitVersion   uint32 // (CMT) Commit Version
	ConfigSize      uint32 // (CSZ) Config JSON Text Size
	BodySize        uint32 // (BSZ) Result Body Size
	CertSize        uint16 // (PCSZ) Public Certificate Size
	SignSize        uint16 // (SSZ) Signature Size
	Certificate     []byte // Public Certificate
	Signature       []byte // Signature: SHA256(Configs + Body)
	Configs         []byte // Configs JSON
	BodyPackageFile string // Body package file
}

******** ------------------------ |MAG|VER|CMT|CSZ|BSZ|PCSZ| Certificate |SSZ| Signature | Configs | Body ------------------------ | 2 | 2 | 4 | 4 | 4 | 2 | ... | 2 | ... ------------------------ *********

Jump to

Keyboard shortcuts

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