| // Copyright 2021 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| library fuchsia.component.config; |
| |
| // This library does not have opinionated size constraints, instead |
| // using `MAX` to indicate that the overall maximum size should |
| // come from a size limit on an overall list of values. |
| |
| /// A configuration value which can be provided to a component. |
| /// |
| /// Used both for storing configuration at-rest and in runtime configuration APIs. |
| type Value = flexible union { |
| 1: single SingleValue; |
| 2: vector VectorValue; |
| }; |
| |
| /// A single configuration value. |
| type SingleValue = flexible union { |
| 1: bool bool; |
| 2: uint8 uint8; |
| 3: uint16 uint16; |
| 4: uint32 uint32; |
| 5: uint64 uint64; |
| 6: int8 int8; |
| 7: int16 int16; |
| 8: int32 int32; |
| 9: int64 int64; |
| 10: string string:MAX; |
| }; |
| |
| /// A vector configuration value. |
| type VectorValue = flexible union { |
| 1: bool_vector vector<bool>:MAX; |
| 2: uint8_vector vector<uint8>:MAX; |
| 3: uint16_vector vector<uint16>:MAX; |
| 4: uint32_vector vector<uint32>:MAX; |
| 5: uint64_vector vector<uint64>:MAX; |
| 6: int8_vector vector<int8>:MAX; |
| 7: int16_vector vector<int16>:MAX; |
| 8: int32_vector vector<int32>:MAX; |
| 9: int64_vector vector<int64>:MAX; |
| 10: string_vector vector<string:MAX>:MAX; |
| }; |