BlossomRepositoryImpl class

Implemented types

Constructors

BlossomRepositoryImpl.new({required HttpRequestDS client})

Properties

client HttpRequestDS
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

checkBlob({required String sha256, required List<String> serverUrls, Nip01Event? authorization}) Future<String>
Checks if the blob exists on the server If authorization is null, the server must be public
override
deleteBlob({required String sha256, required List<String> serverUrls, required Nip01Event authorization}) Future<List<BlobDeleteResult>>
Attempts to delete blob from all servers
override
directDownload({required Uri url}) Future<BlobResponse>
Directly downloads a blob from the url, without blossom
override
getBlob({required String sha256, required List<String> serverUrls, Nip01Event? authorization, int? start, int? end}) Future<BlobResponse>
Gets a blob by trying servers sequentially until success If authorization is null, the server must be public If start and end are null, the entire blob is returned start and end are used to download a range of bytes, @see MDN HTTP range requests
override
getBlobStream({required String sha256, required List<String> serverUrls, Nip01Event? authorization, int chunkSize = 1024 * 1024}) Future<Stream<BlobResponse>>
checks if the server supports range requests, if no server supports range requests, the entire blob is returned otherwise, the blob is returned in chunks. @see MDN HTTP range requests
override
listBlobs({required String pubkey, required List<String> serverUrls, DateTime? since, DateTime? until, Nip01Event? authorization}) Future<List<BlobDescriptor>>
Lists blobs from the first successful server
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
report({required String serverUrl, required String sha256, required Nip01Event reportEvent}) Future<int>
Reports a blob to the server
sha256 is the hash of the blob
reportEvent is the report event
override
supportsRangeRequests({required String sha256, required String serverUrl}) Future<Tuple<bool, int?>>
first value is whether the server supports range requests
second value is the content length of the blob in bytes
override
toString() String
A string representation of this object.
inherited
uploadBlob({required Uint8List data, required Nip01Event authorization, String? contentType, required List<String> serverUrls, UploadStrategy strategy = UploadStrategy.mirrorAfterSuccess, bool mediaOptimisation = false}) Future<List<BlobUploadResult>>
Uploads a blob using the specified strategy
override

Operators

operator ==(Object other) bool
The equality operator.
inherited