Commit Graph

886 Commits

Author SHA1 Message Date
Wolfgang Bumiller
e2d9f676a4 rustfmt
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-23 14:35:12 +01:00
Wolfgang Bumiller
5c120f6abe proxmox::tools: rustfmt
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-23 14:34:48 +01:00
Wolfgang Bumiller
866ec28116 proxmox::test: rustfmt
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-23 14:34:22 +01:00
Wolfgang Bumiller
944ea1e8b7 remove u2f example for now
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-23 14:33:46 +01:00
Wolfgang Bumiller
69a51c9af0 minor cleanup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-23 14:33:08 +01:00
Wolfgang Bumiller
0d68daab86 proxmox::test::io: properly forward flush
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-23 14:31:02 +01:00
Dominik Csapak
e0dad25af4 proxmox: add sparse_copy(_async) to tools::io
this is able to seek the target instead of writing zeroes, which
generates sparse files where supported

also add tests for it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-02-23 14:28:54 +01:00
Dominik Csapak
840e5fda89 proxmox: add test/{io, task} modules
contains:
* AsyncBlocking{Reader,Writer} for dummy async code
  by wrapping a 'standard reader/writer'
* poll_result_once for pulling a future once (copied from pxar)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-02-23 14:28:50 +01:00
Dietmar Maurer
be03039ba9 bump proxmox version to 0.10.6-1 2021-02-21 15:49:40 +01:00
Dietmar Maurer
69ab6bd69d make get_property_string_type_text public
We need that to generate nice docs.
2021-02-21 15:44:13 +01:00
Dietmar Maurer
7212fd3290 bump proxmox version to 0.10.5 2021-02-11 10:46:11 +01:00
Dietmar Maurer
133209c14a implement dump_section_config 2021-02-11 10:44:04 +01:00
Dietmar Maurer
67c7699b23 rename dump_api_parameters to dump_properties
And do not dump object description automatically.
2021-02-11 10:32:39 +01:00
Wolfgang Bumiller
4e375ba95c bump api-macro to 0.3.2-1
This got lost in a rebase...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-11 09:00:44 +01:00
Wolfgang Bumiller
4e08f9ea06 bump proxmox to 0.10.4-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-10 10:18:13 +01:00
Wolfgang Bumiller
cc8f071153 bump api-macro dependency to 0.3.2
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-10 10:17:28 +01:00
Dietmar Maurer
93fc851a29 bump proxmox version to 0.10.3-1 2021-02-10 10:13:32 +01:00
Dietmar Maurer
6cc9c94f49 api: implement schema doc generator for PropertyStrings 2021-02-10 09:26:56 +01:00
Dietmar Maurer
2f7023704b SectionConifg: allow access to plugin properties 2021-02-09 09:09:45 +01:00
Dietmar Maurer
69bee9524f api: add type_text to StringSchema 2021-02-09 09:06:39 +01:00
Dietmar Maurer
4efbdd79ef api: improve reST formating 2021-02-09 08:53:08 +01:00
Dietmar Maurer
4c741b67c7 api: add dump_enum_properties(), make dump_api_parameter pub 2021-02-08 09:13:55 +01:00
Dietmar Maurer
0bc93f5695 bump proxmox to 0.10.2-1 2021-02-05 12:37:11 +01:00
Dietmar Maurer
d014c6f2d1 CliCommandMap: add usage_skip_options to suppress options in generate_usage_str()
This is useful for commands where sub-commands all takes the same options.
You can supress them in the generated manual pages (printdoc), and instead
document them somewhere else.
2021-02-05 12:37:11 +01:00
Wolfgang Bumiller
50e9148853 api-macro: pull in 'extra-traits' feature from syn
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-04 13:11:34 +01:00
Wolfgang Bumiller
cc520cd4a0 cleanup: remove serde_derive dependency
this comes from the 'derive' feature in serde

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-04 11:43:22 +01:00
Fabian Grünbichler
d5c290a824 ignore member crate target dirs as well
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-02-03 11:18:34 +01:00
Wolfgang Bumiller
223d7ed55c api-macro: let tests depend on api-macro
the updater tests require both the trait and the proc macros
to be visible, running tests with `--all-features` prevents
them from being imported from two separate locations as
their names are the same, so let's always include the macro
versions in test cases by depending on the `api-macro`
feature in tests in the api-macro crate

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-03 10:54:18 +01:00
Wolfgang Bumiller
9ee0276f13 doc fixup
not sure if it's worth looking up that link?

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-03 10:54:18 +01:00
Wolfgang Bumiller
dd767723d8 formatting fixups
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-03 10:54:18 +01:00
Wolfgang Bumiller
034dd3fe5e updaters: docs and exports
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-03 10:54:18 +01:00
Wolfgang Bumiller
cc065c175d api-macro: introduce updaters
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-03 10:54:18 +01:00
Wolfgang Bumiller
ab06665649 schema: introduce Updatable and Updater traits
The `Updatable` trait is our mechanism for "updating"
values. The `Updater` trait is a serde-helper to allow using
`skip_serializing_if` on api type structs which
`#[derive(Updater)]`

All basic types implement `Updatable<Updater = Option<T>>`,
and all `Option<T>` where `T: Updatable` are implicitly also
updatable from `Option<T>`.

With the update to the `#[api]` macro, all `#[api]` types
will implicitly `#[derive(Updatable)]` via the default
implementation (which simply assignes from an
`Option<Self>`), unless they explicitly also
`#[derive(Updater)]` in which case an implementation is
derived which goes through each "field" found in the
updater. To prevent fields from being updatable via an
Updater `#[updater(fixed)]` can be used.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-03 10:54:18 +01:00
Wolfgang Bumiller
237f206235 schema: fix AllOf property iteration for nested objects
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-03 10:54:00 +01:00
Wolfgang Bumiller
544c7e7171 schema: support AllOf in ExtractValueDeserializer
fixes nested AllOfs in api methods

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-03 10:53:33 +01:00
Dietmar Maurer
aad324c38b bump proxmox to 0.10.1-1 2021-02-03 08:31:40 +01:00
Dietmar Maurer
3b4f6f2d35 cli: improve completion of array arguments 2021-02-03 08:28:27 +01:00
Fabian Grünbichler
dc5b2bebf1 debcargo: fix maintainer directive
and remove accidentally committed files

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-02-01 11:26:33 +01:00
Fabian Grünbichler
c09d8e1442 clippy: use std::ptr::null
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-20 15:04:49 +01:00
Wolfgang Bumiller
2f7b0872ea clippy fixups
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-01-15 14:20:55 +01:00
Fabian Grünbichler
d44c032dd5 bump proxmox to 0.10.0-1
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-14 15:43:19 +01:00
Fabian Grünbichler
586d94947b bump proxmox-api-macro to 0.3.1-1
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-14 15:42:54 +01:00
Fabian Grünbichler
8e62cf0600 build: add autopkgtest target
which runs the autopkgtests on the built packages.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-14 14:23:45 +01:00
Fabian Grünbichler
43e9cf10af move ParameterSchema from router to schema
it's the place where it belongs, and unbreaks the --no-default-features
build

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-13 13:40:04 +01:00
Wolfgang Bumiller
a5b8f9d340 fix u2f example
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-01-13 11:29:33 +01:00
Fabian Grünbichler
e05dd0074d tokio 1.0: drop TimeoutFutureExt
tokio's Sleep/Delay/Timeout are no longer Unpin, complicating this
wrapper. we can just use tokio::time::timeout directly as needed..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-12 14:29:19 +01:00
Fabian Grünbichler
0319030ed9 update to tokio 1.0
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-12 14:29:19 +01:00
Fabian Grünbichler
c65246e9bd update to rustyline 7
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-12 14:29:19 +01:00
Fabian Grünbichler
27799ccb6d Cargo.toml: update to tokio 1.0
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-12 14:29:19 +01:00
Wolfgang Bumiller
9a290275c3 macro: refactoring
purely non-functional changes

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-01-05 13:50:55 +01:00