// Get executes an external program to get the credentials from a native store.
352956
func Get(program ProgramFunc, serverURL string) (*credentials.Credentials, error) {
	cmd := program("get")
	cmd.Input(strings.NewReader(serverURL))

	out, err := cmd.Output()
	if err != nil {
		t := strings.TrimSpace(string(out))

		if credentials.IsErrCredentialsNotFoundMessage(t) {
			return nil, credentials.NewErrCredentialsNotFound()
		}

		if isValidErr := isValidCredsMessage(t); isValidErr != nil {
			err = isValidErr
		}

		return nil, fmt.Errorf("error getting credentials - err: %v, out: `%s`", err, t)
	}

	resp := &credentials.Credentials{
		ServerURL: serverURL,
	}

	if err := json.NewDecoder(bytes.NewReader(out)).Decode(resp); err != nil {
		return nil, err
	}

	return resp, nil
}
1008983
func (s Storage) Get(bucket, key string, nested ...string) Storage {
	return s.execute(bucket, key, nil, nested, getData)
}
580040
func Get(names ...string) (map[string]string, error) {
	values := map[string]string{}

	var missingEnvVars []string
	for _, envVar := range names {
		value := GetOrFile(envVar)
		if value == "" {
			missingEnvVars = append(missingEnvVars, envVar)
		}
		values[envVar] = value
	}

	if len(missingEnvVars) > 0 {
		return nil, fmt.Errorf("some credentials information are missing: %s", strings.Join(missingEnvVars, ","))
	}

	return values, nil
}
756001
func (c ConfigStore) Get(ctx context.Context) (*chronograf.Config, error) {
	return c.Config, nil
}
1360412
func (c configManager) Get(key string) ([]byte, error) {
	value, err := c.store.Get(key)
	if err != nil {
		return nil, err
	}
	return secconf.Decode(value, bytes.NewBuffer(c.keystore))
}
1045517
func (multi *SourcesStore) Get(ctx context.Context, id int) (chronograf.Source, error) {
	var err error
	for _, store := range multi.Stores {
		var s chronograf.Source
		s, err = store.Get(ctx, id)
		if err == nil {
			return s, nil
		}
	}
	return chronograf.Source{}, err
}
974770
func (s *PostgresStore) Get(key interface{}) interface{} {
	s.lock.RLock()
	defer s.lock.RUnlock()

	return s.data[key]
}
944756
func (environment) Get(key, defaultValue string) string {
	if v, ok := os.LookupEnv(key); ok {
		return v
	}
	return defaultValue
}
1023100
func (r *registry) Get(name string, pluginType consts.PluginType) (func() (interface{}, error), bool) {
	switch pluginType {
	case consts.PluginTypeCredential:
		f, ok := r.credentialBackends[name]
		return toFunc(f), ok
	case consts.PluginTypeSecrets:
		f, ok := r.logicalBackends[name]
		return toFunc(f), ok
	case consts.PluginTypeDatabase:
		f, ok := r.databasePlugins[name]
		return f, ok
	default:
		return nil, false
	}
}
129085
func (s *storeImpl) Get(key string) (interface{}, bool) {
	s.mutex.RLock()
	defer s.mutex.RUnlock()

	object, ok := s.objects[key]
	if !ok {
		return nil, false
	}

	return object.contents, true
}
757741
func (s *NodbStore) Get(key interface{}) interface{} {
	s.lock.RLock()
	defer s.lock.RUnlock()

	return s.data[key]
}
250417
func Get(c context.Context) Store {
	if f, ok := c.Value(contextKey(0)).(Factory); ok && f != nil {
		return f(c)
	}
	return nil
}
570254
func (s *CacheOnStorage) Get(key interface{}) (interface{}, error) {
	if item, err := s.cache.Get(key); err != nil {
		return nil, err
	} else if item != nil {
		return item, nil
	}

	item, err := s.storage.Get(key)
	if err != nil {
		return nil, err
	}

	if err := s.cache.Set(item); err != nil {
		// XXX: Maybe make this a non error
		return nil, err
	}
	return item, nil
}
726780
func (s *Registry) Get(store Store, name string) (session *Session, err error) {
	if !isCookieNameValid(name) {
		return nil, fmt.Errorf("sessions: invalid character in cookie name: %s", name)
	}
	if info, ok := s.sessions[name]; ok {
		session, err = info.s, info.e
	} else {
		session, err = store.New(s.request, name)
		session.name = name
		s.sessions[name] = sessionInfo{s: session, e: err}
	}
	session.store = store
	return
}
698388
func (d *Datastore) Get(k ds.Key) ([]byte, error) {
	o, ok := d.buffer[k]
	if ok {
		if o.delete {
			return nil, ds.ErrNotFound
		}
		return o.value, nil
	}

	return d.child.Get(k)
}
660257
func (ds *RemoteCache) Get(key string) (interface{}, error) {
	return ds.client.Get(key)
}
343541
func (c *Config) Get(key string) (string, error) {
	data, err := load(c.filename, c.passphrase)
	return data[key], err
}