Documentation ¶
Index ¶
- Constants
- func GetIndexdRecordRev(uuid, indexURL string) (string, error)
- func GetObjectSize(client *AwsClient, bucket string, key string) (*int64, error)
- func GetS3ObjectOutput(client *AwsClient, bucket string, key string) (*s3.GetObjectOutput, error)
- func IndexS3Object(s3objectURL string)
- func UpdateIndexdRecord(uuid, rev string, indexdInfo *IndexdInfo, body []byte) (*http.Response, error)
- func UpdateMetadataObject(uuid string, mdsInfo *MetadataServiceInfo, body []byte) (*http.Response, error)
- type AwsClient
- type ConfigInfo
- type HashCollection
- type HashInfo
- type IndexdInfo
- type MetadataServiceInfo
Constants ¶
const ChunkSize = 1024 * 1024 * 64
const MaxRetries = 5
MaxRetries maximum number of retries
Variables ¶
This section is empty.
Functions ¶
func GetIndexdRecordRev ¶
GetIndexdRecordRev gets record rev
func GetObjectSize ¶
GetObjectSize returns object size in bytes
func GetS3ObjectOutput ¶
GetS3ObjectOutput gets object output from s3
func IndexS3Object ¶
func IndexS3Object(s3objectURL string)
IndexS3Object indexes s3 object The fuction does several things. It downloads the object from S3, computes size and hashes, and updates Indexd and potentially Metadata Service
func UpdateIndexdRecord ¶
func UpdateIndexdRecord(uuid, rev string, indexdInfo *IndexdInfo, body []byte) (*http.Response, error)
UpdateIndexdRecord updates the record with size, urls and hashes encoded in body
func UpdateMetadataObject ¶
func UpdateMetadataObject(uuid string, mdsInfo *MetadataServiceInfo, body []byte) (*http.Response, error)
Updates Metadata Service object specified by uuid with provided body
Types ¶
type AwsClient ¶
type AwsClient struct {
// contains filtered or unexported fields
}
AWS sesssion wrapper
func CreateNewAwsClient ¶
CreateNewSession creates an aws s3 session
type ConfigInfo ¶
type ConfigInfo struct { Indexd IndexdInfo `json:"indexd"` MetadataService MetadataServiceInfo `json:"metadataService"` }
type HashCollection ¶
type HashCollection struct { Crc32c hash.Hash Md5 hash.Hash Sha1 hash.Hash Sha256 hash.Hash Sha512 hash.Hash }
HashCollection contains hashes
func CreateNewHashCollection ¶
func CreateNewHashCollection() *HashCollection
CreateNewHashCollection creates a new HashCollection
func UpdateBasicHashes ¶
func UpdateBasicHashes(hashCollection *HashCollection, rd []byte) (*HashCollection, error)
UpdateBasicHashes updates a hashes collection
func (*HashCollection) Reset ¶
func (h *HashCollection) Reset()