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 ¶ 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 NewFileNotFoundError ¶ added in v0.0.3
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 ReadProblemGPGInfoZip ¶ added in v0.0.3
读取题目携带的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只在需要解压的时候才会用到
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 | ... ------------------------ *********
Click to show internal directories.
Click to hide internal directories.