The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Catalyst::Model::MogileFS::Client - Model class of MogileFS::Client on Catalyst

VERSION

Version 0.06

SYNOPSIS

in MyApp.pm

  package MyApp;
    MyApp->config(
      'Model::Storage::MyImage' => {
        domain => 'myimage.art-code.org',
        readonly => 1
    }
  );

INSTALL

At first, you must run mogilefsd and mogstored. For example,

  $ sudo mogstored 
  $ sudo -u mogile mogilefsd

Next, execute Makefile.PL.

METHODS

new([$config])

Constructor. $config must be hash ref. See below for available parameter. More detail in MogileFS::Client.

root

For nfs setup.

domain

MogileFS domain

backend

MogileFS::Backend object

readonly

readonly flag 1 or 0

hosts

trackers hosts as array ref

timeout

timeout sec

reload($config)

Reload MogileFS::Client setting More detail, see 'new' method.

client

Getter for MogileFS::Client original instance

last_tracker

Return last using tracker. See MogileFS::Client, MogileFS::Backend

errstr

Return error message if exists errors. See MogileFS::Client, MogileFS::Backend

errcode

Return error code if exists errors. See MogileFS::Client, MogileFS::Backend

readonly

Readonly flag accessor. See MogileFS::Client, MogileFS::Backend

set_pref_ip($arg)

$arg must be hash ref as {"standard-ip" => "prefferred-ip"}. See MogileFS::Client, MogileFS::Backend

new_file($key, $class[, $bytes, $opts])

Return MogileFS::NewHTTPFile object or undef if no device.

$key

Specified file key name.

$class

Specified class name include files.

$bytes [optional]

The length of the file.

$opt [optional]

It must be hash ref. Now supported option is "fid".

"fid" option is unique file id to use instead of just picking one in the database.

See MogileFS::Client, MogileFS::Backend

store_file($key, $class, $file[, $opt])

$file

File name.

See also new_method about other arguments. See MogileFS::Client, MogileFS::Backend

store_content($key, $class, $content[, $opts])

$content

File content.

See also new_method about other arguments. See MogileFS::Client, MogileFS::Backend

get_paths($key[, $opts])

$key

Specified file key name.

$opts [optional]

Available two option. see below.

noverify

No verify. 0 or 1.

zone

Specified zone value.

See MogileFS::Client, MogileFS::Backend

get_file_data($key[, $timeout])

$key

Specified file key name.

$timeout

Timeout seconds. default 10 sec.

See MogileFS::Client, MogileFS::Backend

delete($key)

Delete file with $key.

See MogileFS::Client, MogileFS::Backend

sleep($duration)

Sleep thread $duration seconds. See MogileFS::Client, MogileFS::Backend

rename($from_key, $to_key)

Rename file key name $from_key to $to_key. See MogileFS::Client, MogileFS::Backend

list_keys($prefix, $after, $limit)

Search key list by $prefix, $after.

$prefix

key's prefix.

$after

key's postfix.

$limit

Limitation of result list count.

See MogileFS::Client, MogileFS::Backend

foreach_keys($opts, $callback)

Apply callback easch list keys.

$opts

Hash ref. Available option is only prefix. See list_keys method.

$callback

Code ref with 1 argument.

See MogileFS::Client, MogileFS::Backend

AUTOLOAD

used to support plugins that have modified the server, this builds things into an argument list and passes them back to the server

See MogileFS::Client, MogileFS::Backend

AUTHOR

Toru Yamaguchi, <zigorou at cpan.org>

SEE ALSO

MogileFS::Client
Catalyst::Model
Catalyst
NEXT

BUGS

Please report any bugs or feature requests to bug-catalyst-model-mogilefs-client at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Catalyst-Model-MogileFS-Client. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Catalyst::Model::MogileFS::Client

You can also look for information at:

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2006 Toru Yamaguchi, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.