// HgetString performs the hget command to return string.
548352
func HgetString(key string, field int) string {
	c, err := redis.Dial("tcp", GetRedisServer())
	if err != nil {
		panic(err)
	}
	defer c.Close()

	value, err := redis.String(c.Do("HGET", key, field))
	if err != nil {
		fmt.Println("key not found")
	}

	return value
}
522781
func ToString(v Value) string {
	if s, ok := v.(String); ok {
		return string(s)
	}
	return StringOf(v)
}
896111
func HTTPGet(httpUrl string) ([]byte, error) {

	r, err := http.Get(httpUrl)

	if err != nil {
		return nil, err
	}

	defer r.Body.Close()

	if err != nil {
		return nil, err
	}

	// read the response and check
	body, err := ioutil.ReadAll(r.Body)
	if err != nil {
		return nil, err
	}

	return body, nil
}
464955
func (c *Client) HGetAll(key string) (map[string]string, error) {
	v, err := c.execWithKey(true, "HGETALL", key)
	if err != nil {
		return nil, err
	}
	return iface2strmap(v), nil
}
287208
func (h Hex) ToString() string {
	s := fmt.Sprintf("%x", h.Value)
	if len(s)%2 != 0 {
		s = "0" + s
	}

	// should never error.
	b, _ := hex.DecodeString(s)
	return string(b)
}
1313174
func (pg *GoEvtxMap) GetString(path *GoEvtxPath) (string, error) {
	pE, err := pg.Get(path)
	if err != nil {
		return "", err
	}
	if s, ok := (*pE).(string); ok {
		return s, nil
	}
	return "", fmt.Errorf("Bad type expect string got %T", (*pE))
}
1135191
func (s *Session) GetString(key string, def string) string {
	v, ok := s.Values[key]
	if !ok {
		return def
	}

	return v.(string)
}
1082092
func (m Metadata) GetString(key string) (*string, error) {
	val, ok := m[key]
	if !ok {
		return nil, ErrMetadataNonexistantKey
	}
	if val.Type != MetadataValueTypeString {
		return nil, ErrMetadataUnexpectedValueType
	}
	out, _ := val.Value.(string)
	return &out, nil
}
1151121
func (v *OrderedValues) StringGet(key string) string {
	if len(key) == 0 {
		return ""
	}
	return string(v.Get([]byte(key)))
}
1186582
func (r *Request) BodyString(data string) *Request {
	r.Use(body.String(data))
	return r
}
1263478
func (s *ValidateService) BodyString(body string) *ValidateService {
	s.bodyString = body
	return s
}
56997
func GetString(n ast.Node) (string, error) {
	if node, ok := n.(*ast.BasicLit); ok && node.Kind == token.STRING {
		return strconv.Unquote(node.Value)
	}
	return "", fmt.Errorf("Unexpected AST node type: %T", n)
}
1061498
func hashString(input string) string {
	defer loggerHighwayHasher.Reset()
	loggerHighwayHasher.Write([]byte(input))
	checksum := loggerHighwayHasher.Sum(nil)
	return hex.EncodeToString(checksum)
}
449692
func (r *Request) BodyString(body string) *Request {
	r.BodyBuffer = []byte(body)
	return r
}
1054228
func (v *Value) GetTypeString() string {
	switch v.vType {
	case typeNull:
		return "NULL"
	case typeBool:
		return "BOOL"
	case typeString:
		return "STRING"
	case typeInt:
		return "INT"
	case typeFloat:
		return "FLOAT"
	case typeTimestamp:
		return "TIMESTAMP"
	case typeBytes:
		return "BYTES"
	}
	return "--"
}
363498
func HTTPGet(url string, headers [][]string, username, password string) ([]byte, error) {
	client := &http.Client{Transport: &transport}
	req, err := http.NewRequest("GET", url, nil)

	if err != nil {
		return nil, err
	}

	if username != "" && password != "" {
		req.SetBasicAuth(username, password)
	}

	if len(headers) > 0 {
		for i := range headers {
			req.Header.Add(headers[i][0], headers[i][1])
		}
	}
	return makeRequest(client, req)
}
742725
func (c *PackageFile) GetString(header, tag int) string {
	if c == nil || header >= len(c.Headers) {
		return ""
	}
	return c.Headers[header].Indexes.StringByTag(tag)
}