github.com/LanceLRQ/deer-common@v0.0.9-0.20210319081233-e8222ac018a8/persistence/judge_result/structs.go (about)

     1  package judge_result
     2  
     3  /*********
     4  ------------------------
     5  |MAG|VER|CMP|RSZ|BSZ|CSZ| Certificate |SSZ| Signature | Result | Body
     6  ------------------------
     7  | 2 | 1 | 1 | 4 | 4 | 2 | ... | 2 | ...
     8  ------------------------
     9  **********/
    10  type JudgeResultPackage struct {
    11  	Version         uint8  // (VER) Package Version
    12  	CompressorType  uint8  // (CMP) Compressor type: 0-disabled; 1-gzip
    13  	ResultSize      uint32 // (RSZ) Result JSON Text Size
    14  	BodySize        uint32 // (BSZ) Result Body Size
    15  	CertSize        uint16 // (CSZ) Public Certificate Size
    16  	SignSize        uint16 // (SSZ) Signature Size
    17  	Certificate     []byte // Public Certificate
    18  	Signature       []byte // Signature: SHA256(Result + Body)
    19  	Result          []byte // Result JSON
    20  	BodyPackageFile string // Body package file (内部成员,不输出)
    21  }
    22  
    23  /***
    24  已弃用
    25  ------------------------
    26  Magic | Size | FileName | Content
    27  ------------------------
    28    2   |  4  | (Sep: \n) |  ...
    29  ------------------------
    30  ***/
    31  type JudgeResultPackageBody struct {
    32  	BodyPackageFile string
    33  	Files           []struct {
    34  		Size     uint32
    35  		FileName string
    36  		Position uint32
    37  	}
    38  }