Documentation ¶
Overview ¶
Copyright 2021 SANGFOR TECHNOLOGIES
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func KeyToField(key string) string
- func OutputToMap(cmdOutput []string, countList []int, otype string) (map[string]string, error)
- func ParseChannel(topology string, ctype string, portMap map[string]string) (*dtstruct.BaseInfo, error)
- func ResetValue(structInstance interface{}, infoMap map[string]string, ignoreMiss bool) error
- func UpdateHostAndPort(kvs map[string]string, ip string, hostname string, port string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KeyToField ¶
KeyToField format key to struct field name, e.g. instance_id -> InstanceId TODO key demo: datanodePort or HA_state or instance_state, key is not unified, this is bad design
func OutputToMap ¶
OutputToMap filter valid output, transfer it to key/value, check if result count is in count list
func ParseChannel ¶
func ParseChannel(topology string, ctype string, portMap map[string]string) (*dtstruct.BaseInfo, error)
ParseChannel parse channel info from gs_ctl query
func ResetValue ¶
ResetValue reset field of struct instance value using key/value in info map
Types ¶
This section is empty.