1 # -*- encoding: binary -*-
3 # To read more about \MogileFS, go to http://mogilefs.org/
5 # Client usage information is available in MogileFS::MogileFS.
10 # Standard error class for most MogileFS-specific errors
11 class Error < StandardError; end
13 # Raised when a socket remains unreadable for too long.
14 class UnreadableSocketError < Error; end
16 # Raised when a response is truncated while reading
17 # due to network/server # errors)
18 class SizeMismatchError < Error; end
20 # Raised when checksum verification fails (only while reading deprecated
21 # "bigfiles" from the deprecated mogtool(1).
22 class ChecksumMismatchError < RuntimeError; end
24 # Raised when a backend is in read-only mode
25 class ReadOnlyError < Error
26 def message; 'readonly mogilefs'; end
29 # Raised when an upload is impossible
30 class EmptyPathError < Error; end
32 # Raised when we are given an unsupported protocol to upload to.
33 # Currently, the \MogileFS (2.54) server only supports HTTP and
34 # this library is only capable of HTTP.
35 class UnsupportedPathError < Error; end
37 # Raised when a request (HTTP or tracker) was truncated due to a network or
38 # server error. It may be possible to retry idempotent requests from this.
39 class RequestTruncatedError < Error; end
41 # Raised when a response from a server (HTTP or tracker) is not in a format
42 # that we expected (or truncated..
43 class InvalidResponseError < Error; end
45 # Raised when all known backends have failed.
46 class UnreachableBackendError < Error; end
48 # IO.copy_stream was buggy in Ruby 1.9.2 and earlier
49 if RUBY_VERSION >= "1.9.3"
52 require "mogilefs/copy_stream"
53 X = MogileFS::CopyStream
56 # autoload rarely-used things:
57 autoload :Mysql, 'mogilefs/mysql'
58 autoload :Pool, 'mogilefs/pool'
59 autoload :Admin, 'mogilefs/admin'
63 require 'mogilefs/util'
64 require 'mogilefs/socket'
65 require 'mogilefs/backend'
66 require 'mogilefs/http_file'
67 require 'mogilefs/http_reader'
68 require 'mogilefs/client'
69 require 'mogilefs/bigfile'
70 require 'mogilefs/mogilefs'
71 require 'mogilefs/version' # generated by ./GIT-VERSION-GEN