Skip to content

Commit 598240c

Browse files
committed
feat docs: use schemas in core for docs in more cases
Tests: протестировано локально commit_hash:8e1b78f04004d85606046c5d11c468ed2c828ecc
1 parent 5dcc110 commit 598240c

File tree

69 files changed

+483
-406
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+483
-406
lines changed

clickhouse/src/storages/clickhouse/component.yaml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,30 @@ additionalProperties: false
44
properties:
55
secdist_alias:
66
type: string
7-
description: name of the key in secdist config
8-
defaultDescription: '<components name>'
7+
description: |
8+
Name of the key in secdist config.
9+
10+
Default: '<components name>'
911
initial_pool_size:
1012
type: integer
1113
description: number of connections created initially
12-
defaultDescription: 5
14+
default: 5
1315
max_pool_size:
1416
type: integer
1517
description: maximum number of created connections
16-
defaultDescription: 10
18+
default: 10
1719
queue_timeout:
1820
type: string
1921
description: client waiting for a free connection time limit
20-
defaultDescription: 1s
22+
default: 1s
2123
use_secure_connection:
2224
type: boolean
2325
description: whether to use TLS for connections
24-
defaultDescription: true
26+
default: true
2527
compression:
2628
type: string
27-
description: compression method to use (none / lz4)
28-
defaultDescription: none
29+
description: compression method to use
30+
default: none
31+
enum:
32+
- none
33+
- lz4

cmake/UserverGenerateComponentsSchemaDocs.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function(_userver_add_target_gen_component_schemas_docs)
2-
file(GLOB_RECURSE YAML_FILENAMES */src/*.yaml)
2+
file(GLOB_RECURSE YAML_FILENAMES */src/*.yaml */static_configs/*.yaml)
33

44
add_custom_target(
55
userver-gen-components-schema-docs

core/include/userver/clients/dns/component.hpp

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,19 @@ USERVER_NAMESPACE_BEGIN
1111

1212
namespace clients::dns {
1313

14-
// clang-format off
15-
1614
/// @ingroup userver_components
1715
///
1816
/// @brief Caching DNS resolver component.
1917
///
2018
/// Returned references to clients::dns::Resolver live for a lifetime
2119
/// of the component and are safe for concurrent use.
2220
///
23-
/// ## Static options:
24-
/// Name | Description | Default value
25-
/// ---- | ----------- | -------------
26-
/// fs-task-processor | task processor for disk I/O operations | engine::current_task::GetBlockingTaskProcessor()
27-
/// hosts-file-path | path to the `hosts` file | /etc/hosts
28-
/// hosts-file-update-interval | `hosts` file cache reload interval | 5m
29-
/// network-timeout | timeout for network requests | 1s
30-
/// network-attempts | number of attempts for network requests | 1
31-
/// network-custom-servers | list of name servers to use | from `/etc/resolv.conf`
32-
/// cache-ways | number of ways for network cache | 16
33-
/// cache-size-per-way | size of each way of network cache | 256
34-
/// cache-max-reply-ttl | TTL limit for network replies caching | 5m
35-
/// cache-failure-ttl | TTL for network failures caching | 5s
21+
/// ## Static options of clients::dns::Component :
22+
/// @include{doc} scripts/docs/en/components_schema/core/static_configs/dns_client.md
3623
///
3724
/// ## Static configuration example:
3825
///
3926
/// @snippet components/common_component_list_test.cpp Sample dns client component config
40-
41-
// clang-format on
4227
class Component final : public components::ComponentBase {
4328
public:
4429
/// @ingroup userver_component_names

core/src/cache/caching_component_base.yaml

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,52 +14,56 @@ properties:
1414
description: (*required*) interval between Update invocations
1515
update-jitter:
1616
type: string
17-
description: max. amount of time by which update-interval may be adjusted
18-
for requests dispersal
19-
defaultDescription: update_interval / 10
17+
description: |
18+
Max. amount of time by which update-interval may be adjusted
19+
for requests dispersal.
20+
21+
Default: update_interval / 10
2022
updates-enabled:
2123
type: boolean
2224
description: if false, cache updates are disabled (except for the first one
2325
if !first-update-fail-ok)
24-
defaultDescription: true
26+
default: true
2527
full-update-interval:
2628
type: string
2729
description: interval between full updates
2830
full-update-jitter:
2931
type: string
30-
description: max. amount of time by which full-update-interval may be adjusted
31-
for requests dispersal
32-
defaultDescription: full-update-interval / 10
32+
description: |
33+
Max. amount of time by which full-update-interval may be adjusted
34+
for requests dispersal.
35+
36+
Default: full-update-interval / 10
3337
exception-interval:
3438
type: string
3539
description: sleep interval after an unhandled exception
36-
defaultDescription: update_interval
40+
default: update_interval
3741
first-update-fail-ok:
3842
type: boolean
3943
description: whether first update failure is non-fatal
40-
defaultDescription: false
44+
default: false
4145
task-processor:
4246
type: string
4347
description: the name of the TaskProcessor for running DoWork
44-
defaultDescription: main-task-processor
48+
default: main-task-processor
4549
config-settings:
4650
type: boolean
4751
description: enables dynamic reconfiguration with CacheConfigSet
48-
defaultDescription: true
52+
default: true
4953
additional-cleanup-interval:
5054
type: string
5155
description: how often to run background RCU garbage collector
52-
defaultDescription: 10 seconds
56+
default: 10 seconds
5357
is-strong-period:
5458
type: boolean
5559
description: whether to include Update execution time in update-interval
56-
defaultDescription: false
60+
default: false
5761
has-pre-assign-check:
5862
type: boolean
5963
description: |
6064
enables the check before changing the value in the cache, by
6165
default it is the check that the new value is not empty
62-
defaultDescription: false
66+
default: false
6367
testsuite-force-periodic-update:
6468
type: boolean
6569
description: |
@@ -76,15 +80,15 @@ properties:
7680
fire an alert if the cache update failed specified amount of times
7781
in a row. If zero - alerts are disabled. Value from dynamic config
7882
takes priority over static
79-
defaultDescription: 0
83+
default: 0
8084
minimum: 0
8185
safe-data-lifetime:
8286
type: boolean
8387
description: |
8488
enables awaiting data destructors in the component's destructor.
8589
Can be set to `false` if the stored data does not refer to the component
8690
and its dependencies.
87-
defaultDescription: true
91+
default: true
8892
dump:
8993
type: object
9094
description: Manages cache behavior after dump load
@@ -104,7 +108,7 @@ properties:
104108
- skip
105109
- required
106110
- best-effort
107-
defaultDescription: skip
111+
default: skip
108112
first-update-type:
109113
type: string
110114
description: |
@@ -113,4 +117,4 @@ properties:
113117
- full
114118
- incremental
115119
- incremental-then-async-full
116-
defaultDescription: full
120+
default: full

core/src/cache/lru_cache_component_base.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ properties:
1111
lifetime:
1212
type: string
1313
description: TTL for cache entries (0 is unlimited)
14-
defaultDescription: 0
14+
default: 0
1515
background-update:
1616
type: boolean
1717
description: enables asynchronous updates for expiring values
18-
defaultDescription: false
18+
default: false
1919
config-settings:
2020
type: boolean
2121
description: enables dynamic reconfiguration with CacheConfigSet
22-
defaultDescription: true
22+
default: true

core/src/clients/http/component.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ properties:
55
core-component:
66
type: string
77
description: name of components::HttpClientCore component to use
8-
defaultDescription: http-client-core
8+
default: http-client-core
99
middlewares:
1010
type: object
1111
description: map of middlewares to apply. Middleware settings from components::HttpClient

core/src/clients/http/component_core.yaml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,36 @@ properties:
55
pool-statistics-disable:
66
type: boolean
77
description: set to true to disable statistics for connection pool
8-
defaultDescription: false
8+
default: false
99
thread-name-prefix:
1010
type: string
1111
description: set OS thread name to this value
12-
defaultDescription: ''
12+
default: ''
1313
threads:
1414
type: integer
1515
description: number of threads to process low level HTTP related IO system
1616
calls
17-
defaultDescription: 8
17+
default: 8
1818
fs-task-processor:
1919
type: string
20-
description: task processor to run blocking HTTP related calls, like DNS resolving
21-
or hosts reading
22-
defaultDescription: engine::current_task::GetBlockingTaskProcessor()
20+
description: |
21+
Task processor to run blocking HTTP related calls, like DNS resolving
22+
or hosts reading.
23+
24+
Default: engine::current_task::GetBlockingTaskProcessor()
2325
destination-metrics-auto-max-size:
2426
type: integer
2527
description: set max number of automatically created destination metrics
26-
defaultDescription: 100
28+
default: 100
2729
user-agent:
2830
type: string
2931
description: User-Agent HTTP header to show on all requests, result of utils::GetUserverIdentifier()
3032
if empty
31-
defaultDescription: ''
33+
default: ''
3234
testsuite-enabled:
3335
type: boolean
3436
description: enable testsuite testing support
35-
defaultDescription: false
37+
default: false
3638
testsuite-timeout:
3739
type: string
3840
description: if set, force the request timeout regardless of the value passed
@@ -47,7 +49,7 @@ properties:
4749
dns_resolver:
4850
type: string
4951
description: server hostname resolver type
50-
defaultDescription: 'async'
52+
default: 'async'
5153
enum:
5254
- getaddrinfo
5355
- async
@@ -58,11 +60,11 @@ properties:
5860
using the original timeout and the value of task-inherited deadline.
5961
Note: timeout is always updated from the task-inherited deadline
6062
when present.
61-
defaultDescription: true
63+
default: true
6264
cancellation-policy:
6365
type: string
6466
description: Cancellation policy for new requests
6567
enum:
6668
- cancel
6769
- ignore
68-
defaultDescription: 'cancel'
70+
default: 'cancel'

core/src/clients/http/middlewares/retry_budget/component.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ properties:
55
max-tokens:
66
type: number
77
description: max amount of tokens in the token bucket
8-
defaultDescription: 10
8+
default: 10
99
token-ratio:
1010
type: number
1111
description: retry count to successful responses ratio
12-
defaultDescription: 0.1
12+
default: 0.1

core/src/components/fs_cache.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ properties:
55
dir:
66
type: string
77
description: directory to cache files from
8-
defaultDescription: /var/www
8+
default: /var/www
99
update-period:
1010
type: string
1111
description: |
1212
update period (0 - fill the cache only at startup)
13-
defaultDescription: 0
13+
default: 0
1414
fs-task-processor:
1515
type: string
16-
description: task processor to do filesystem operations
17-
defaultDescription: engine::current_task::GetBlockingTaskProcessor()
16+
description: |
17+
Task processor to do filesystem operations
18+
19+
Default: engine::current_task::GetBlockingTaskProcessor()

core/src/components/impl/component_base.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ properties:
66
load-enabled:
77
type: boolean
88
description: set to `false` to disable loading of the component
9-
defaultDescription: true
9+
default: true

0 commit comments

Comments
 (0)