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