Dists

NAME

Zeco::Query::Dists

SYNOPSIS

Methods for handling the processes around dist management.

method remove-dist(QRemoveDist, $user --> Result)

Signature: QRemoveDist - the dist to be removed
           $user       - hash of the pre-authed user
Returns: a Result object.

Returns NotFound if the delete window is past or the dist is not found in the
current index. Returns InvalidAuth if the user does not have permission to
remove the dist.  Success otherwise.

This method is intended to remove the dist from the `dists` table when the
config value `delete-window` (in hours) has not passed, or when the value is
less than zero. If the config value is zero then a dist can be removed any
time.

method ingest-upload(QIngestUpload, $user --> Result)

Signature: QIngestUpload - the dist to be indexed 
           $user         - hash of the pre-authed user
Returns: a Result object

Does several checks against the dist:

- Verify the dist can be extracted by standard tooling
  -> UnableToExtractArchive
- Ensures a META6.json file is present and can be parsed by raku's JSON
  internal methods -> UnableToLocateMeta6
- Confirms user is a member of the group in the META6's auth or is the
  use in the auth -> InvalidAuth
- Makes sure the dist name contains at least one a-z0-9 character
  -> InvalidMeta6Json
- Ensures a `provides` section is there (does not verify contents)
  -> InvalidMeta6Json
- Runs a script specified by the config to do something with the index
  -> IndexFailed (TODO)
- Returns Success

After the checks this will attempt to run the command in
config.dist-move-command as follows:

config.dist-move-command <path to .tar.tz> <expected path at destination>

method generate-full-meta(--> Result)

Returns: MetaIndex 

Retrieves all non-deleted dists from the `dists` table and returns them in a
nicely typed object (as a list).

Zeco v0.0.3

An ecosystem hosting module for raku

Authors

    License

    Artistic-2.0

    Dependencies

    Humming-Bird:ver<3.0.0+>Humming-Bird::CoreNet::DNSDB::Pgraku-mailgunCrypt::RandomEmail::ValidTOML:auth<zef:tony-o>Digest::SHA1::Native

    Test Dependencies

    Provides

    • Zeco
    • Zeco::Config
    • Zeco::DB
    • Zeco::Dist
    • Zeco::Email
    • Zeco::Group
    • Zeco::Query
    • Zeco::Query::Dists
    • Zeco::Query::Groups
    • Zeco::Query::Users
    • Zeco::Responses
    • Zeco::User
    • Zeco::Util::BCrypt
    • Zeco::Util::BST
    • Zeco::Util::Json
    • Zeco::Util::Middleware
    • Zeco::Util::Process
    • Zeco::Util::Types

    The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.