common

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ok
	OK = "ok"

	// server err
	ERR_SystemErr = "system error"

	// rpc err
	ERR_RPCConnection = "failed to connect to rpc, please try again later."

	// client err
	ERR_FragmentSize        = "the fragment size is wrong"
	ERR_FragmentHash        = "the fragment hash is wrong"
	ERR_FragmentNotMatchFid = "fragment does not match fid"
	ERR_NotFound            = "not found"
	ERR_HashLength          = "invalid fid or fragment"
	ERR_EmptyHashName       = "empty fid or fragment"

	// signature err
	ERR_InvalidSignature = "invalid signature"

	// range err
	ERR_InvalidRangeValue = "invalid range request"
	ERR_InvalidRangeTotal = "invalid range total"
	ERR_InvalidRangeStart = "invalid range start"
	ERR_InvalidRangeEnd   = "invalid range end"
)
View Source
const (
	Header_Account         = "Account"
	Header_Message         = "Message"
	Header_Signature       = "Signature"
	Header_Fid             = "Fid"
	Header_Fragment        = "Fragment"
	Header_Range           = "Range"
	Header_ContentType     = "Content-Type"
	Header_X_Forwarded_For = "X-Forwarded-For"
)

Variables

This section is empty.

Functions

func ReturnJSON

func ReturnJSON(c *gin.Context, code int, msg string, data any)

Types

type FileBlockProofInfo

type FileBlockProofInfo struct {
	ProofHashSign       []byte         `json:"proofHashSign"`
	ProofHashSignOrigin []byte         `json:"proofHashSignOrigin"`
	SpaceProof          *pb.SpaceProof `json:"spaceProof"`
	FileBlockFront      int64          `json:"fileBlockFront"`
	FileBlockRear       int64          `json:"fileBlockRear"`
}

type IdleProofInfo

type IdleProofInfo struct {
	Start               uint32                `json:"start"`
	ChainFront          int64                 `json:"chainFront"`
	ChainRear           int64                 `json:"chainRear"`
	IdleResult          bool                  `json:"idleResult"`
	CanSubmintProof     bool                  `json:"submintProof"`
	CanSubmintResult    bool                  `json:"submintResult"`
	AllocatedTeeWorkpuk chain.WorkerPublicKey `json:"allocatedTeeWorkpuk"`
	IdleProof           []types.U8            `json:"idleProof"`
	Acc                 []byte                `json:"acc"`
	TotalSignature      []byte                `json:"totalSignature"`
	ChallRandom         []int64               `json:"challRandom"`
	FileBlockProofInfo  []FileBlockProofInfo  `json:"fileBlockProofInfo"`
	BlocksProof         []*pb.BlocksProof     `json:"blocksProof"`
}

type RandomList

type RandomList struct {
	Index  []uint32 `json:"index"`
	Random [][]byte `json:"random"`
}

type RespType

type RespType struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	Data any    `json:"data"`
}

type ServiceProofInfo

type ServiceProofInfo struct {
	SignatureHex    string                `json:"signature_hex"`
	Proof           []types.U8            `json:"proof"`
	BloomFilter     chain.BloomFilter     `json:"bloom_filter"`
	TeePublicKey    chain.WorkerPublicKey `json:"tee_public_key"`
	Start           uint32                `json:"start"`
	Result          bool                  `json:"result"`
	CanSubmitProof  bool                  `json:"can_submit_proof"`
	CanSubmitResult bool                  `json:"can_submit_result"`
}

Jump to

Keyboard shortcuts

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