BlossomRepository class abstract

Implementers

Constructors

BlossomRepository.new()

Properties

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
deleteBlob({required String sha256, required List<String> serverUrls, required Nip01Event authorization}) Future<List<BlobDeleteResult>>
Attempts to delete blob from all servers
directDownload({required Uri url}) Future<BlobResponse>
Directly downloads a blob from the url, without blossom
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
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
listBlobs({required String pubkey, required List<String> serverUrls, DateTime? since, DateTime? until, Nip01Event? authorization}) Future<List<BlobDescriptor>>
Lists blobs from the first successful server
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
report({required String sha256, required Nip01Event reportEvent, required String serverUrl}) Future<int>
Reports a blob to the server
sha256 is the hash of the blob
reportEvent is the report event
supportsRangeRequests({required String sha256, required String serverUrl}) Future<Tuple<bool, int?>>
Checks if the server supports range requests and gets the content length
first value is whether the server supports range requests
second value is the content length of the blob in bytes
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

Operators

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