All Projects → BinaryBirds → liquid

BinaryBirds / liquid

Licence: MIT License
Abstract file storage component made for Vapor 4.

Programming Languages

swift
15916 projects
Makefile
30231 projects

Projects that are alternatives of or similar to liquid

acid-store
A library for secure, deduplicated, transactional, and verifiable data storage
Stars: ✭ 48 (+65.52%)
Mutual labels:  s3
docker-aws-s3-sync
Docker container to sync a folder to Amazon S3
Stars: ✭ 21 (-27.59%)
Mutual labels:  s3
apt-golang-s3
An s3 transport method for the apt package management system
Stars: ✭ 33 (+13.79%)
Mutual labels:  s3
astro
Astro allows rapid and clean development of {Extract, Load, Transform} workflows using Python and SQL, powered by Apache Airflow.
Stars: ✭ 79 (+172.41%)
Mutual labels:  s3
S4
🔄 Fast and cheap synchronisation of files using Amazon S3
Stars: ✭ 69 (+137.93%)
Mutual labels:  s3
herman
Herman is a tool to simplify deployment of AWS Services using ECS and Lambda, and the provisioning of various AWS services.
Stars: ✭ 33 (+13.79%)
Mutual labels:  s3
s3-db
Document DB API for AWS S3
Stars: ✭ 97 (+234.48%)
Mutual labels:  s3
s3-sync
Migrating S3 Buckets Across AWS Accounts
Stars: ✭ 55 (+89.66%)
Mutual labels:  s3
websync
Like `aws s3 sync` with automatic CloudFront invalidations and more.
Stars: ✭ 45 (+55.17%)
Mutual labels:  s3
Layr
A decentralized (p2p) file storage system built atop Kademlia DHT that enforces data integrity, privacy, and availability through sharding, proofs of retrievability, redundancy, and encryption, with smart-contract powered incentive scheme
Stars: ✭ 90 (+210.34%)
Mutual labels:  file-storage
nginx-s3-gateway
NGINX S3 Caching Gateway
Stars: ✭ 124 (+327.59%)
Mutual labels:  s3
punic
Punic is a remote cache CLI built for Carthage and Apple .xcframework
Stars: ✭ 25 (-13.79%)
Mutual labels:  s3
gitlab-mattermost-backup
A simple backup script for mattermost in gitlab omnibus package
Stars: ✭ 23 (-20.69%)
Mutual labels:  s3
GooglePlay-Web-Crawler
Mapreduce project by Hadoop, Nutch, AWS EMR, Pig, Tez, Hive
Stars: ✭ 18 (-37.93%)
Mutual labels:  s3
s3-lambda-transcribe-audio-to-text-s3
Transcribe your audio to text with this serverless component
Stars: ✭ 84 (+189.66%)
Mutual labels:  s3
S4
S4 is 100% S3 compatible storage, accessed through Tor and distributed using IPFS.
Stars: ✭ 67 (+131.03%)
Mutual labels:  s3
laravel-uppy-s3-multipart-upload
Multipart Uploads using Laravel, AWS S3, and Uppy
Stars: ✭ 30 (+3.45%)
Mutual labels:  s3
radio
Redundant Array of Distributed Independent Objectstores in short RADIO performs synchronous mirroring, erasure coding across multiple object stores
Stars: ✭ 25 (-13.79%)
Mutual labels:  s3
vapor-queues-fluent-driver
A Fluent implementation for https://github.com/vapor/queues (Vapor4)
Stars: ✭ 17 (-41.38%)
Mutual labels:  vapor-4
Less3
Less3 is an S3-compatible object storage server that runs on your laptop, servers, just about anywhere!
Stars: ✭ 16 (-44.83%)
Mutual labels:  s3

Liquid

Abstract file storage component made for Vapor 4 using the LiquidKit file storage solution.

Supported drivers

⚠️ In order to use the AWS S3 driver you have to configure your credentials.

Usage example

Add Liquid as a dependency using SPM (with the driver that you'd like to use):

// swift-tools-version:5.3
import PackageDescription

let package = Package(
    name: "myProject",
    platforms: [
       .macOS(.v10_15)
    ],
    dependencies: [
        .package(url: "https://github.com/vapor/vapor.git", from: "4.41.0"),
        .package(url: "https://github.com/binarybirds/liquid.git", from: "1.2.0"),
        .package(url: "https://github.com/binarybirds/liquid-local-driver.git", from: "1.2.0"),
        .package(url: "https://github.com/binarybirds/liquid-aws-s3-driver.git", from: "1.1.0"),
    ],
    targets: [
        .target(name: "App", dependencies: [
            .product(name: "Vapor", package: "vapor"),
            .product(name: "Liquid", package: "liquid"),
            .product(name: "LiquidLocalDriver", package: "liquid-local-driver"),
            .product(name: "LiquidAwsS3Driver", package: "liquid-aws-s3-driver"),
        ]),
    ]
)

Driver configuration

import Liquid
import LiquidLocalDriver
import LiquidAwsS3Driver

public func configure(_ app: Application) throws {

    app.middleware.use(FileMiddleware(publicDirectory: app.directory.publicDirectory))

    // using the local driver
    app.fileStorages.use(.local(publicUrl: "http://localhost:8080/",
                                publicPath: app.directory.publicDirectory,
                                workDirectory: "assets"), as: .local)

    // using the AWS S3 driver (credentials must be configured as well)
    app.fileStorages.use(.awsS3(region: .uswest1, bucket: "testbucket"), as: .awsS3)

}

Basic usage example:

func testUpload(req: Request) -> EventLoopFuture<String> {
    let data: Data = //...
    let key = "path/to/my/file.txt"
    // the upload method returns the full url of the uploaded file
    return req.fs.upload(key: key, data: data)
    
    /// resolve public url based on a key
    // req.fs.resolve(key: myImageKey)

    /// delete file based on a key
    // req.fs.delete(key: myImageKey)
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].