Documentation ¶
Overview ¶
Copyright © 2023 pld
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2023 pld ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2023 pld ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2023 pld ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2023 pld ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2023 pld ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2023 pld ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2023 pld ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2023 pld ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2023 pld ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2023 pld ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2023 pld ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- Variables
- func Error(cmd *cobra.Command, args []string, err error)
- func Execute()
- func GenerateShardingCarFiles(req *model.CarFileUploadReq, ...) error
- func GetApiVersion() string
- func GetBucketName(args []string) string
- func GetDataPath(args []string) string
- func GetTimestampString() string
- func ImportBigCarFile(sdk *chainstoragesdk.CssClient, req *model.CarFileUploadReq) (model.ObjectCreateResponse, error)
- func ImportData(sdk *chainstoragesdk.CssClient, bucketId int, dataPath string) (model.ObjectCreateResponse, error)
- func UploadBigCarFile(sdk *chainstoragesdk.CssClient, req *model.CarFileUploadReq) (model.ObjectCreateResponse, error)
- func UploadData(sdk *chainstoragesdk.CssClient, bucketId int, dataPath string) (model.ObjectCreateResponse, error)
- type BucketCreateOutput
- type BucketEmptyOutput
- type BucketListOutput
- type BucketOutput
- type BucketRemoveOutput
- type CarImportOutput
- type CarUploadOutput
- type CarUploadResponse
- type CliConfig
- type CscConfig
- type DagFileNode
- type LoggerConfig
- type ObjectDownloadOutput
- type ObjectListOutput
- type ObjectOutput
- type ObjectRemoveOutput
- type ObjectRenameOutput
- type PlainFormatter
- type SdkConfig
- type VersionInfo
Constants ¶
This section is empty.
Variables ¶
var CliVersion string
var ErrNotDir = fmt.Errorf("not a directory")
Functions ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func GenerateShardingCarFiles ¶
func GenerateShardingCarFiles(req *model.CarFileUploadReq, shardingCarFileUploadReqs *[]model.CarFileUploadReq) error
生成CAR分片文件
func GetApiVersion ¶ added in v0.0.4
func GetApiVersion() string
func GetBucketName ¶
func GetDataPath ¶
func GetTimestampString ¶
func GetTimestampString() string
func ImportBigCarFile ¶
func ImportBigCarFile(sdk *chainstoragesdk.CssClient, req *model.CarFileUploadReq) (model.ObjectCreateResponse, error)
导入大CAR文件
func ImportData ¶
func ImportData(sdk *chainstoragesdk.CssClient, bucketId int, dataPath string) (model.ObjectCreateResponse, error)
导入CAR文件数据
func UploadBigCarFile ¶
func UploadBigCarFile(sdk *chainstoragesdk.CssClient, req *model.CarFileUploadReq) (model.ObjectCreateResponse, error)
上传大CAR文件
func UploadData ¶
func UploadData(sdk *chainstoragesdk.CssClient, bucketId int, dataPath string) (model.ObjectCreateResponse, error)
上传数据
Types ¶
type BucketCreateOutput ¶
type BucketCreateOutput struct { RequestId string `json:"requestId,omitempty"` Code int32 `json:"code,omitempty"` Msg string `json:"msg,omitempty"` Status string `json:"status,omitempty"` Data BucketOutput `json:"bucketOutput,omitempty"` }
type BucketEmptyOutput ¶
type BucketEmptyOutput struct { RequestId string `json:"requestId,omitempty"` Code int32 `json:"code,omitempty"` Msg string `json:"msg,omitempty"` Status string `json:"status,omitempty"` Data BucketOutput `json:"bucketOutput,omitempty"` }
type BucketListOutput ¶
type BucketListOutput struct { RequestId string `json:"requestId,omitempty"` Code int32 `json:"code,omitempty"` Msg string `json:"msg,omitempty"` Status string `json:"status,omitempty"` Count int `json:"count,omitempty"` PageIndex int `json:"pageIndex,omitempty"` PageSize int `json:"pageSize,omitempty"` List []BucketOutput `json:"list,omitempty"` }
type BucketOutput ¶
type BucketOutput struct { Id int `json:"id" comment:"桶ID"` BucketName string `json:"bucketName" comment:"桶名称(3-63字长度限制)"` StorageNetworkCode int `json:"storageNetworkCode" comment:"存储网络编码(10001-IPFS)"` BucketPrincipleCode int `json:"bucketPrincipleCode" comment:"桶策略编码(10001-公开,10000-私有)"` UsedSpace int64 `json:"usedSpace" comment:"已使用空间(字节)"` ObjectAmount int `json:"objectAmount" comment:"对象数量"` CreatedAt time.Time `json:"createdAt" comment:"创建时间"` StorageNetwork string `json:"storageNetwork" comment:"存储网络(10001-IPFS)"` BucketPrinciple string `json:"bucketPrinciple" comment:"桶策略(10001-公开,10000-私有)"` CreatedDate string `json:"createdDate" comment:"创建日期"` FormatUsedSpace string `json:"formatUsedSpace" comment:"格式化已使用空间"` }
type BucketRemoveOutput ¶
type BucketRemoveOutput struct { RequestId string `json:"requestId,omitempty"` Code int32 `json:"code,omitempty"` Msg string `json:"msg,omitempty"` Status string `json:"status,omitempty"` Data BucketOutput `json:"bucketOutput,omitempty"` }
type CarImportOutput ¶
type CarImportOutput struct { RequestId string `json:"requestId,omitempty"` Code int32 `json:"code,omitempty"` Msg string `json:"msg,omitempty"` Status string `json:"status,omitempty"` Data ObjectOutput `json:"objectOutput,omitempty"` }
type CarUploadOutput ¶
type CarUploadOutput struct { RequestId string `json:"requestId,omitempty"` Code int32 `json:"code,omitempty"` Msg string `json:"msg,omitempty"` Status string `json:"status,omitempty"` Data ObjectOutput `json:"objectOutput,omitempty"` }
type CarUploadResponse ¶
type CliConfig ¶
type CliConfig struct { IpfsGateway string `toml:"ipfsGateway"` GgcscmdPath string `toml:"ggcscmdPath"` UseHTTPSProtocol bool `toml:"useHttpsProtocol"` BucketPrefix string `toml:"bucketPrefix"` ListOffset int `toml:"listOffset"` CleanTmpData bool `toml:"cleanTmpData"` MaxRetries int `toml:"maxRetries"` RetryDelay int `toml:"retryDelay"` }
type CscConfig ¶
type CscConfig struct { Cli CliConfig `toml:"cli"` Sdk SdkConfig `toml:"sdk"` Logger LoggerConfig `toml:"logger"` }
type DagFileNode ¶ added in v0.0.7
type DagFileNode struct {
// contains filtered or unexported fields
}
type LoggerConfig ¶
type ObjectDownloadOutput ¶
type ObjectDownloadOutput struct { RequestId string `json:"requestId,omitempty"` Code int32 `json:"code,omitempty"` Msg string `json:"msg,omitempty"` Status string `json:"status,omitempty"` Data ObjectOutput `json:"objectOutput,omitempty"` }
type ObjectListOutput ¶
type ObjectListOutput struct { RequestId string `json:"requestId,omitempty"` Code int32 `json:"code,omitempty"` Msg string `json:"msg,omitempty"` Status string `json:"status,omitempty"` Count int `json:"count,omitempty"` PageIndex int `json:"pageIndex,omitempty"` PageSize int `json:"pageSize,omitempty"` List []ObjectOutput `json:"list,omitempty"` }
type ObjectOutput ¶
type ObjectOutput struct { Id int `json:"id" comment:"对象ID"` BucketId int `json:"bucketId" comment:"桶主键"` ObjectName string `json:"objectName" comment:"对象名称(255字限制)"` ObjectTypeCode int `json:"objectTypeCode" comment:"对象类型编码"` ObjectSize int64 `json:"objectSize" comment:"对象大小(字节)"` IsMarked int `json:"isMarked" comment:"星标(1-已标记,0-未标记)"` ObjectCid string `json:"objectCid" comment:"对象CID"` CreatedAt time.Time `json:"createdAt" comment:"创建时间"` UpdatedAt time.Time `json:"updatedAt" comment:"最后更新时间"` CreatedDate string `json:"createdDate" comment:"创建日期"` FormatObjectSize string `json:"formatObjectSize" comment:"格式化对象大小"` }
type ObjectRemoveOutput ¶
type ObjectRemoveOutput struct { RequestId string `json:"requestId,omitempty"` Code int32 `json:"code,omitempty"` Msg string `json:"msg,omitempty"` Status string `json:"status,omitempty"` Data ObjectOutput `json:"objectOutput,omitempty"` }
type ObjectRenameOutput ¶
type ObjectRenameOutput struct { RequestId string `json:"requestId,omitempty"` Code int32 `json:"code,omitempty"` Msg string `json:"msg,omitempty"` Status string `json:"status,omitempty"` Data ObjectOutput `json:"objectOutput,omitempty"` }
type PlainFormatter ¶
type PlainFormatter struct { }
type SdkConfig ¶
type SdkConfig struct { DefaultRegion string `toml:"defaultRegion"` TimeZone string `toml:"timeZone"` ChainStorageApiEndpoint string `toml:"chainStorageApiEndpoint"` CarFileWorkPath string `toml:"carFileWorkPath"` CarFileShardingThreshold int `toml:"carFileShardingThreshold"` ChainStorageApiToken string `toml:"chainStorageApiToken"` HTTPRequestUserAgent string `toml:"httpRequestUserAgent"` HTTPRequestOvertime int `toml:"httpRequestOvertime"` CarVersion int `toml:"carVersion"` UseHTTPSProtocol bool `toml:"useHttpsProtocol"` }
type VersionInfo ¶ added in v0.0.4
func GetVersionInfo ¶ added in v0.0.4
func GetVersionInfo() *VersionInfo