module Seaweed
Public Class Methods
connect(host: "localhost", port: 9333, http_options: {})
click to toggle source
# File lib/seaweed.rb, line 3 def self.connect(host: "localhost", port: 9333, http_options: {}) Seaweed::HTTP.configure http_options Seaweed::Master.connect host: host, port: port end
find(fid, http_options: nil)
click to toggle source
# File lib/seaweed.rb, line 18 def self.find(fid, http_options: nil) location = Seaweed::Master.dir_lookup fid.split(",")[0] Seaweed::File.new fid, volume_url: location[:url] end
status()
click to toggle source
# File lib/seaweed.rb, line 8 def self.status Seaweed::Master.status end
upload(path)
click to toggle source
# File lib/seaweed.rb, line 12 def self.upload(path) location = Seaweed::Master.dir_assign! file = Seaweed::File.new location[:fid], volume_url: location[:url], attachment: path file.upload! end