Documentation ¶
Index ¶
- Constants
- type ArchiveReader
- func (r *ArchiveReader) GetEntityId() string
- func (r *ArchiveReader) GetNotUploadedMxcUris() []string
- func (r *ArchiveReader) HasManifest() bool
- func (r *ArchiveReader) ProcessFile(file io.ReadCloser, opts ProcessOpts) error
- func (r *ArchiveReader) ProcessS3Files(opts ProcessOpts) error
- func (r *ArchiveReader) TryGetManifestFrom(file io.ReadCloser) (bool, error)
- type ArchiveWriter
- type Manifest
- type ManifestRecord
- type ManifestVersionVal
- type MediaInfo
- type PartPersister
- type ProcessOpts
Constants ¶
View Source
const ManifestVersion = ManifestVersionV2
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArchiveReader ¶
type ArchiveReader struct {
// contains filtered or unexported fields
}
func NewReader ¶
func NewReader(ctx rcontext.RequestContext) *ArchiveReader
func (*ArchiveReader) GetEntityId ¶
func (r *ArchiveReader) GetEntityId() string
func (*ArchiveReader) GetNotUploadedMxcUris ¶
func (r *ArchiveReader) GetNotUploadedMxcUris() []string
func (*ArchiveReader) HasManifest ¶
func (r *ArchiveReader) HasManifest() bool
func (*ArchiveReader) ProcessFile ¶
func (r *ArchiveReader) ProcessFile(file io.ReadCloser, opts ProcessOpts) error
func (*ArchiveReader) ProcessS3Files ¶
func (r *ArchiveReader) ProcessS3Files(opts ProcessOpts) error
func (*ArchiveReader) TryGetManifestFrom ¶
func (r *ArchiveReader) TryGetManifestFrom(file io.ReadCloser) (bool, error)
type ArchiveWriter ¶
type ArchiveWriter struct {
// contains filtered or unexported fields
}
func NewWriter ¶
func NewWriter(ctx rcontext.RequestContext, exportId string, entity string, partSize int64, writeFn PartPersister) (*ArchiveWriter, error)
func (*ArchiveWriter) AppendMedia ¶
func (w *ArchiveWriter) AppendMedia(file io.ReadCloser, info MediaInfo) (string, error)
AppendMedia / returns (sha256hash, error)
func (*ArchiveWriter) Finish ¶
func (w *ArchiveWriter) Finish() error
type Manifest ¶
type Manifest struct { Version ManifestVersionVal `json:"version"` EntityId string `json:"entity_id"` CreatedTs int64 `json:"created_ts"` Media map[string]*ManifestRecord `json:"media"` // Deprecated: for v1 manifests, now called EntityId UserId string `json:"user_id,omitempty"` }
type ManifestRecord ¶
type ManifestRecord struct { FileName string `json:"name"` ArchivedName string `json:"file_name"` SizeBytes int64 `json:"size_bytes"` ContentType string `json:"content_type"` S3Url string `json:"s3_url"` Sha256 string `json:"sha256"` Origin string `json:"origin"` MediaId string `json:"media_id"` CreatedTs int64 `json:"created_ts"` Uploader string `json:"uploader"` }
type ManifestVersionVal ¶
type ManifestVersionVal int
const ( ManifestVersionV1 ManifestVersionVal = 1 ManifestVersionV2 ManifestVersionVal = 2 )
type PartPersister ¶
type PartPersister func(part int, fileName string, data io.ReadCloser) error
type ProcessOpts ¶
type ProcessOpts struct { LockedEntityId string CheckUploadedOnly bool ProcessFunction func(record *ManifestRecord, f io.ReadCloser) error }
Click to show internal directories.
Click to hide internal directories.