David K. Bainbridge | 9189c63 | 2021-03-26 21:52:21 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2021-present Ciena Corporation |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package config |
| 17 | |
| 18 | import ( |
| 19 | "time" |
| 20 | ) |
| 21 | |
| 22 | type GrpcConfigSpec struct { |
| 23 | ConnectTimeout time.Duration `yaml:"connectTimeout"` |
| 24 | Timeout time.Duration `yaml:"timeout"` |
| 25 | MaxCallRecvMsgSize string `yaml:"maxCallRecvMsgSize"` |
| 26 | } |
| 27 | |
| 28 | type KvStoreConfigSpec struct { |
| 29 | Timeout time.Duration `yaml:"timeout"` |
| 30 | } |
| 31 | |
| 32 | type TlsConfigSpec struct { |
| 33 | UseTls bool `yaml:"useTLS"` |
| 34 | CACert string `yaml:"caCert"` |
| 35 | Cert string `yaml:"cert"` |
| 36 | Key string `yaml:"key"` |
| 37 | Verify bool `yaml:"verify"` |
| 38 | } |
| 39 | |
| 40 | type StackConfigSpec struct { |
| 41 | Name string `yaml:"name"` |
| 42 | Server string `yaml:"server"` |
| 43 | Kafka string `yaml:"kafka"` |
| 44 | KvStore string `yaml:"kvstore"` |
| 45 | Tls TlsConfigSpec `yaml:"tls"` |
| 46 | Grpc GrpcConfigSpec `yaml:"grpc"` |
| 47 | KvStoreConfig KvStoreConfigSpec `yaml:"kvstoreconfig"` |
| 48 | K8sConfig string `yaml:"-"` |
| 49 | } |
| 50 | |
| 51 | type GlobalConfigSpec struct { |
| 52 | ApiVersion string `yaml:"apiVersion"` |
| 53 | Stacks []*StackConfigSpec `yaml:"stacks"` |
| 54 | CurrentStack string `yaml:"currentStack"` |
| 55 | } |