// GetValue an abstraction to return key's value in respective type
175682
func (arc *ConfigFactory) GetValue(key string) cast.Value {
	if arc.initSuccess == false {
		return nil
	}

	var confValue cast.Value
	val := arc.GetConfigurationByKey(key)
	if val == nil {
		confValue = cast.NewValue(nil, errors.New("key does not exist"))
	} else {
		confValue = cast.NewValue(val, nil)
	}

	return confValue
}
279500
func (c *Client) GetValues(keys []string) (map[string]string, error) {
	allEnvVars := os.Environ()
	envMap := make(map[string]string)
	for _, e := range allEnvVars {
		index := strings.Index(e, "=")
		envMap[e[:index]] = e[index+1:]
	}
	vars := make(map[string]string)
	for _, key := range keys {
		k := transform(key)
		for envKey, envValue := range envMap {
			if strings.HasPrefix(envKey, k) {
				vars[clean(envKey)] = envValue
			}
		}
	}

	log.Debug(fmt.Sprintf("Key Map: %#v", vars))

	return vars, nil
}
1186131
func getValue(val interface{}, context string) string {
	keys := strings.Split(context, ".")

	if keys[0] == "(root)" {
		keys = keys[1:]
	}

	for i, k := range keys {
		switch typedVal := (val).(type) {
		case string:
			return typedVal
		case []interface{}:
			if index, err := strconv.Atoi(k); err == nil {
				val = typedVal[index]
			}
		case RawServiceMap:
			val = typedVal[k]
		case RawService:
			val = typedVal[k]
		case map[interface{}]interface{}:
			val = typedVal[k]
		}

		if i == len(keys)-1 {
			return fmt.Sprint(val)
		}
	}

	return ""
}
240686
func (m *ContextManager) GetValue(key interface{}) (
	value interface{}, ok bool) {
	gid, ok := GetGoroutineId()
	if !ok {
		return nil, false
	}

	m.mtx.Lock()
	state, found := m.values[gid]
	m.mtx.Unlock()

	if !found {
		return nil, false
	}
	value, ok = state[key]
	return value, ok
}
1065484
func (wr *protoWatchResp) GetValue(msg proto.Message) error {
	return wr.serializer.Unmarshal(wr.BytesWatchResp.GetValue(), msg)
}
115397
func (c *Config) GetValues(key string) (v *Values) {
	v, _ = c.GetValuesOk(key)
	return
}
50416
func (db *BytesConnectionEtcd) GetValue(key string) (data []byte, found bool, revision int64, err error) {
	return getValueInternal(db.Logger, db.etcdClient, db.opTimeout, key)
}
521144
func (r *ProtoWatchRespWrapper) GetValue(value proto.Message) error {
	return r.ProtoKeyValWrapper.GetValue(value)
}
540966
func (c *Client) GetValues(keys []string) (map[string]string, error) {
	vars := make(map[string]string)
	for _, key := range keys {
		resp, err := c.client.Get(context.Background(), key, &client.GetOptions{
			Recursive: true,
			Sort:      true,
			Quorum:    true,
		})
		if err != nil {
			return vars, err
		}
		err = nodeWalk(resp.Node, vars)
		if err != nil {
			return vars, err
		}
	}
	return vars, nil
}
192643
func (list *List) GetValue() interface{} {
	var values []interface{}
	for _, val := range list.values {
		values = append(values, val.GetValue())
	}
	return values
}
1000826
func (b *Bundle) get(key string, value interface{}) error {
	raw, ok := b.Values[key]
	if !ok || raw == nil || len(*raw) == 0 {
		return ErrNoSettings
	}

	typ := reflect.TypeOf(value)

	// Fast path for already-in-cache values.
	b.lock.RLock()
	cached, ok := b.unpacked[key]
	b.lock.RUnlock()

	// Slow path.
	if !ok {
		b.lock.Lock()
		defer b.lock.Unlock() // its fine to hold the lock until return

		cached, ok = b.unpacked[key]
		if !ok {
			// 'value' must be a pointer to a struct.
			if typ.Kind() != reflect.Ptr || typ.Elem().Kind() != reflect.Struct {
				return ErrBadType
			}
			// 'cached' is &Struct{}.
			cached = reflect.New(typ.Elem()).Interface()
			if err := json.Unmarshal([]byte(*raw), cached); err != nil {
				return err
			}
			if b.unpacked == nil {
				b.unpacked = make(map[string]interface{}, 1)
			}
			b.unpacked[key] = cached
		}
	}

	// Note: the code below may be called with b.lock in locked or unlocked state.

	// All calls to 'get' must use same type consistently.
	if reflect.TypeOf(cached) != typ {
		return ErrBadType
	}

	// 'value' and 'cached' are &Struct{}, Do *value = *cached.
	reflect.ValueOf(value).Elem().Set(reflect.ValueOf(cached).Elem())
	return nil
}
96561
func (d *DB) GetByValue(value string) (keys []string) {
	valueB := []byte(value)
	d.db.Update(func(tx *bolt.Tx) error {
		b := tx.Bucket(tableURLs)
		if b == nil {
			return nil
		}
		c := b.Cursor()
		// first for the bucket's table "urls"
		for k, v := c.First(); k != nil; k, v = c.Next() {
			if bytes.Equal(valueB, v) {
				keys = append(keys, string(k))
			}
		}

		return nil
	})

	return
}
35008
func (c *Client) GetValues(keys []string) (map[string]string, error) {
	vars := make(map[string]string)
	for _, key := range keys {
		// Check if we can find the single item
		m := make(map[string]*dynamodb.AttributeValue)
		m["key"] = &dynamodb.AttributeValue{S: aws.String(key)}
		g, err := c.client.GetItem(&dynamodb.GetItemInput{Key: m, TableName: &c.table})
		if err != nil {
			return vars, err
		}

		if g.Item != nil {
			if val, ok := g.Item["value"]; ok {
				if val.S != nil {
					vars[key] = *val.S
				} else {
					log.Warning("Skipping key '%s'. 'value' is not of type 'string'.", key)
				}
				continue
			}
		}

		// Check for nested keys
		q, err := c.client.Scan(
			&dynamodb.ScanInput{
				ScanFilter: map[string]*dynamodb.Condition{
					"key": &dynamodb.Condition{
						AttributeValueList: []*dynamodb.AttributeValue{
							&dynamodb.AttributeValue{S: aws.String(key)}},
						ComparisonOperator: aws.String("BEGINS_WITH")}},
				AttributesToGet: []*string{aws.String("key"), aws.String("value")},
				TableName:       aws.String(c.table),
				Select:          aws.String("SPECIFIC_ATTRIBUTES"),
			})

		if err != nil {
			return vars, err
		}

		for _, i := range q.Items {
			item := i
			if val, ok := item["value"]; ok {
				if val.S != nil {
					vars[*item["key"].S] = *val.S
				} else {
					log.Warning("Skipping key '%s'. 'value' is not of type 'string'.", *item["key"].S)
				}
				continue
			}
		}
	}
	return vars, nil
}
588839
func (sqlite3 *Sqlite3DB) GetVal(key string) string {
	var val string
	sqlCmd := fmt.Sprintf("select FieldValue from %s where FieldKey = ?", sqlite3.TableName)
	rows, errDB := sqlite3.GolDB.Query(sqlCmd, key)
	if errDB != nil {
		golerror.Boohoo("Statement failed for Key "+key+" query.", false)
		return ""
	}
	for rows.Next() {
		if val != "" {
			golerror.Boohoo("Multiple Key "+key+" found. Should be Primary.", false)
			return val
		}
		if errDB = rows.Scan(&val); errDB != nil {
			golerror.Boohoo("Key "+key+" query failed.", false)
			return ""
		}
	}
	if errDB = rows.Err(); errDB != nil {
		golerror.Boohoo("Key "+key+" query failed, rows have error.", false)
	}
	rows.Close()
	return string(val)
}
891307
func (cm *ProtoConsumerMessage) GetValue(msg proto.Message) error {
	err := cm.serializer.Unmarshal(cm.ConsumerMessage.GetValue(), msg)
	if err != nil {
		return err
	}
	return nil
}
1050969
func (e *Entry) Get(key string) *ValueData {
	for i := range e.Values {
		if e.Values[i].Key == key {
			return &e.Values[i]
		}
	}
	return nil
}
1205245
func (meta Metadata) GetValueString(key string) string {
	return string(meta.GetValue(key))
}