util

package
v0.0.0-...-6b32d26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2021 License: Apache-2.0 Imports: 7 Imported by: 4

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeyToField

func KeyToField(key string) string

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

func OutputToMap(cmdOutput []string, countList []int, otype string) (map[string]string, error)

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

func ResetValue(structInstance interface{}, infoMap map[string]string, ignoreMiss bool) error

ResetValue reset field of struct instance value using key/value in info map

func UpdateHostAndPort

func UpdateHostAndPort(kvs map[string]string, ip string, hostname string, port string)

UpdateHostAndPort replace ip in key hostname use real host name

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL