Documentation
¶
Index ¶
- Constants
- func CheckPortAvailability(usedPort map[int32]struct{}) bool
- func CheckVersion(targetVersionStr, versionStr string) error
- func DecryptAES256CFB(encryptedData, key []byte, iv []byte) ([]byte, error)
- func DecryptData(filename string, ciphertext []byte) ([]byte, error)
- func EncryptData(filename string, plaintext []byte) ([]byte, error)
- func GenerateRSAKeyPair(bits int) (*rsa.PrivateKey, *rsa.PublicKey, error)
- func IsPortAvailable(port int) bool
- func MonitorShutdown(triggerCh <-chan struct{}, handlers ...ShutdownHandler) <-chan struct{}
- func ReadPrivateKey(filename string) ([]byte, error)
- func ReadPublicKey(filename string) ([]byte, error)
- func ReqContext() context.Context
- func RunPythonScript(scriptPath ...string) (string, error)
- func SavePrivateEMKey(filename string, key *rsa.PrivateKey) error
- func SavePublicPEMKey(filename string, pubkey *rsa.PublicKey) error
- func StreamPythonScriptOutput(wg *sync.WaitGroup, scriptPath ...string)
- type BasicResponse
- type ShutdownHandler
- type StopFunc
Constants ¶
View Source
const ( SuccessCode = 200 ServerError = 500 GetLocationError = 3000 GetCpAccountError = 3001 GeResourceError = 3002 JsonError = 4000 BadParamError = 4001 SignatureError = 4002 SpaceParseResourceUriError = 4003 CheckResourcesError = 4004 SpaceCheckWhiteListError = 4005 NoAvailableResourcesError = 4006 FoundJobEntityError = 4007 NotFoundJobEntityError = 4008 SaveJobEntityError = 4009 FoundWhiteListError = 4010 FoundBlackListError = 4011 SpaceCheckBlackListError = 4012 CheckBalanceError = 4013 RejectZkTaskError = 4014 DownloadResourceError = 4015 PortNoAvailableError = 4016 GenerateRsaError = 4017 SaveRsaKeyError = 4018 ReadRsaKeyError = 4019 CheckNodePortError = 4020 CheckResourceLimitError = 4021 NotAcceptNodePortError = 4022 RpcConnectError = 4023 CheckPriceError = 4024 BelowPriceError = 4025 ReadPriceError = 4026 ReadLogError = 4027 ProofParamError = 7001 ProofReadLogError = 7002 ProofError = 7003 UbiTaskParamError = 8001 UbiTaskContractError = 8002 FoundTaskEntityError = 8003 SaveTaskEntityError = 8004 SubmitProofError = 8005 )
View Source
const ( RSA_DIR_NAME = "dcc" RSA_PUBLIC_KEY = "public_key.pem" RSA_PRIVATE_KEY = "private_key.pem" )
Variables ¶
This section is empty.
Functions ¶
func CheckPortAvailability ¶ added in v0.7.0
func CheckVersion ¶ added in v1.1.1
func DecryptAES256CFB ¶ added in v0.6.4
func DecryptData ¶ added in v0.6.4
func EncryptData ¶ added in v0.6.4
func GenerateRSAKeyPair ¶ added in v0.6.4
func IsPortAvailable ¶ added in v1.0.0
func MonitorShutdown ¶
func MonitorShutdown(triggerCh <-chan struct{}, handlers ...ShutdownHandler) <-chan struct{}
func ReadPrivateKey ¶ added in v0.6.4
func ReadPublicKey ¶ added in v0.6.4
func ReqContext ¶
func RunPythonScript ¶
func SavePrivateEMKey ¶ added in v0.6.4
func SavePrivateEMKey(filename string, key *rsa.PrivateKey) error
func SavePublicPEMKey ¶ added in v0.6.4
Types ¶
type BasicResponse ¶
type BasicResponse struct { Status string `json:"status"` Code int `json:"code"` Data interface{} `json:"data,omitempty"` Message string `json:"message,omitempty"` }
func CreateErrorResponse ¶
func CreateErrorResponse(code int, errMsg ...string) BasicResponse
func CreateSuccessResponse ¶
func CreateSuccessResponse(_data interface{}) BasicResponse
type ShutdownHandler ¶
Click to show internal directories.
Click to hide internal directories.