class GolangHostedFacetImpl extends FacetSupport implements GolangHostedFacet {

  @Transactional
  @Override
  public Content getList(final String module) {
    checkNotNull(module);

    StorageTx tx = UnitOfWork.currentTx();

    Iterable<Asset> assetsForModule = golangDataAccess.findAssetsForModule(tx, getRepository(), module);

    List<String> collection = StreamSupport.stream(assetsForModule.spliterator(), false)
        .filter(asset -> PACKAGE.name().equals(asset.formatAttributes().get(P_ASSET_KIND)))
        .map(Asset::name)
        .map(name -> name.split("/@v/")[1])
        .map(name -> name.replaceAll(".zip", ""))
        .collect(Collectors.toList());

    if (collection.isEmpty()) {
      return null;
    }

    String listOfVersions = String.join("\n", collection);

    return new Content(new BytesPayload(listOfVersions.getBytes(UTF_8), TEXT_PLAIN));
  }

  @Inject public  GolangHostedFacetImpl(final GolangDataAccess golangDataAccess,
                               final CompressedContentExtractor compressedContentExtractor);

}