COOPENOMICS  v1
Кооперативная Экономика
table_apps_packages.hpp
См. документацию.
1#pragma once
2
3
4#include "../core/ram_payer.hpp"
5#include <eosio/eosio.hpp>
6#include <eosio/crypto.hpp>
7#include <string>
8#include <vector>
9
10#include "../consts.hpp"
11
12namespace Apps {
13
14using namespace eosio;
15
43struct [[eosio::table, eosio::contract(APPS)]] package {
44 name package_id; // PK, кодовое имя
45 std::string package_name; // внешнее имя (npm/go/oci)
46 name owner; // владелец (username разработчика)
47 std::vector<name> compatible_subnets; // labels подсетей: "ru","by",...
48 std::string last_active_version; // semver последнего scope=all active
49 time_point_sec created_at;
50 time_point_sec updated_at;
51
52 uint64_t primary_key() const { return package_id.value; }
53 uint64_t by_owner() const { return owner.value; }
54 uint64_t by_subnet() const {
55 return compatible_subnets.empty() ? 0 : compatible_subnets[0].value;
56 }
57};
58
59typedef eosio::multi_index<
60 "packages"_n, package,
61 eosio::indexed_by<"byowner"_n, eosio::const_mem_fun<package, uint64_t, &package::by_owner>>,
62 eosio::indexed_by<"bysubnet"_n, eosio::const_mem_fun<package, uint64_t, &package::by_subnet>>>
64
65} // namespace Apps
66
67// Плательщик за оперативную память строк таблицы — правило в lib/core/ram_payer.hpp.
const auto owner
Definition: eosio.limitauth_tests.cpp:16
contract
Definition: eosio.msig_tests.cpp:977
Definition: apps.hpp:75
eosio::multi_index< "packages"_n, package, eosio::indexed_by<"byowner"_n, eosio::const_mem_fun< package, uint64_t, &package::by_owner > >, eosio::indexed_by<"bysubnet"_n, eosio::const_mem_fun< package, uint64_t, &package::by_subnet > > > packages_index
Definition: table_apps_packages.hpp:63
Definition: eosio.msig.hpp:34
Запись каталога: один зарегистрированный пакет.
Definition: table_apps_packages.hpp:43
uint64_t by_subnet() const
Definition: table_apps_packages.hpp:54
time_point_sec created_at
Definition: table_apps_packages.hpp:49
name owner
Definition: table_apps_packages.hpp:46
uint64_t by_owner() const
Definition: table_apps_packages.hpp:53
time_point_sec updated_at
Definition: table_apps_packages.hpp:50
name package_id
Definition: table_apps_packages.hpp:44
uint64_t primary_key() const
Definition: table_apps_packages.hpp:52
std::vector< name > compatible_subnets
Definition: table_apps_packages.hpp:47
std::string last_active_version
Definition: table_apps_packages.hpp:48
std::string package_name
Definition: table_apps_packages.hpp:45
RAM_PAYER_CLASS(Apps::package, contract)