Documentation ¶
Index ¶
- func FindInZip(zipArchive *zip.ReadCloser, fileName string) (*io.ReadCloser, *zip.File, error)
- func IsFileNotFoundError(e error) bool
- func NewFileNotFoundError(fileName string) error
- func PackProblems(configuration *commonStructs.JudgeConfiguration, ...) error
- func PackProblemsAsZip(options *persistence.ProblemPackageOptions) error
- func ReadProblemGPGInfo(problemFile string) (string, error)
- func ReadProblemGPGInfoZip(problemFile string) (string, error)
- func ReadProblemInfo(problemFile string, unpack, validate bool, workDir string) (*commonStructs.JudgeConfiguration, string, error)
- func ReadProblemInfoZip(problemFile string, unpack, validate bool, workDir string) (*commonStructs.JudgeConfiguration, string, error)
- func UnZip(zipArchive *zip.ReadCloser, destDir string) error
- func WalkZip(zipArchive *zip.ReadCloser, walkFunc func(file *zip.File) error) error
- type FileNotFoundError
- type ProblemPackage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindInZip ¶
func FindInZip(zipArchive *zip.ReadCloser, fileName string) (*io.ReadCloser, *zip.File, error)
FindInZip 搜索zip内的文件并打开(精确匹配)
func IsFileNotFoundError ¶
IsFileNotFoundError check is file not found error
func NewFileNotFoundError ¶
NewFileNotFoundError new a file not found error
func PackProblems ¶
func PackProblems( configuration *commonStructs.JudgeConfiguration, options *persistence.ProblemPackageOptions, ) error
PackProblems 执行题目数据表打包操作
func PackProblemsAsZip ¶
func PackProblemsAsZip(options *persistence.ProblemPackageOptions) error
PackProblemsAsZip 执行题目数据表打包操作(打包成zip版本)
func ReadProblemGPGInfo ¶
ReadProblemGPGInfo 读取题目携带的GPG信息
func ReadProblemGPGInfoZip ¶
ReadProblemGPGInfoZip 读取题目携带的GPG信息(ZIP)
func ReadProblemInfo ¶
func ReadProblemInfo(problemFile string, unpack, validate bool, workDir string) (*commonStructs.JudgeConfiguration, string, error)
ReadProblemInfo 读取题目信息
func ReadProblemInfoZip ¶
func ReadProblemInfoZip(problemFile string, unpack, validate bool, workDir string) (*commonStructs.JudgeConfiguration, string, error)
ReadProblemInfoZip 读取题目信息(ZIP) workDir只在需要解压的时候才会用到
Types ¶
type FileNotFoundError ¶
type FileNotFoundError struct {
FileName string
}
FileNotFoundError file not found error
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 }
ProblemPackage 题目包-数据结构 ------------------------ |MAG|VER|CMT|CSZ|BSZ|PCSZ| Certificate |SSZ| Signature | Configs | Body ------------------------ | 2 | 2 | 4 | 4 | 4 | 2 | ... | 2 | ... ------------------------
Click to show internal directories.
Click to hide internal directories.