1 // Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 // use this file except in compliance with the License. You may obtain a copy of 3 // the License at 4 // 5 // http://www.apache.org/licenses/LICENSE-2.0 6 // 7 // Unless required by applicable law or agreed to in writing, software 8 // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 // License for the specific language governing permissions and limitations under 11 // the License. 12 13 package driver 14 15 import "context" 16 17 // Config represents all the config sections. 18 type Config map[string]ConfigSection 19 20 // ConfigSection represents all key/value pairs for a section of configuration. 21 type ConfigSection map[string]string 22 23 // Configer is an optional interface that may be implemented by a [Client] to 24 // allow access to reading and setting server configuration. 25 type Configer interface { 26 Config(ctx context.Context, node string) (Config, error) 27 ConfigSection(ctx context.Context, node, section string) (ConfigSection, error) 28 ConfigValue(ctx context.Context, node, section, key string) (string, error) 29 SetConfigValue(ctx context.Context, node, section, key, value string) (string, error) 30 DeleteConfigKey(ctx context.Context, node, section, key string) (string, error) 31 } 32