// load is invoked after the creation of a fuse.Node that may contain extended
// attributes.  This creates the node's xattr map as well as fills it with any
// extended attributes found in the permanode's claims.
542763
func (x *xattr) load(p *search.DescribedPermanode) {
	x.mu.Lock()
	defer x.mu.Unlock()

	*x.xattrs = map[string][]byte{}
	for k, v := range p.Attr {
		if strings.HasPrefix(k, xattrPrefix) {
			name := k[len(xattrPrefix):]
			val, err := base64.StdEncoding.DecodeString(v[0])
			if err != nil {
				Logger.Printf("Base64 decoding error on attribute %v: %v", name, err)
				continue
			}
			(*x.xattrs)[name] = val
		}
	}
}
702616
func (m *resolversMap) Load(key string) (resolver.Resolver, bool) {
	i, ok := m.data.Load(key)
	if !ok {
		return nil, false
	}
	s, ok := i.(resolver.Resolver)
	return s, ok
}
1002616
func (d config) Load(filename string) error {
	d.lock.Lock()
	defer d.lock.Unlock()
	if d.clnt != nil {
		return loadFileConfigEtcd(filename, d.clnt, d.data)
	}
	return loadFileConfig(filename, d.data)
}
896588
func (db *PGStore) load(session *sessions.Session) error {
	var s PGSession

	err := db.selectOne(&s, session.ID)
	if err != nil {
		return err
	}

	return securecookie.DecodeMulti(session.Name(), string(s.Data), &session.Values, db.Codecs...)
}
841121
func (p *plugin) Load() {
	dir, file := filepath.Split(p.Path())
	p.name = file
	name := filepath.Base(dir) + "." + file[:len(file)-3]
	s, err := py.NewUnicode(name)
	if err != nil {
		log.Warn(err)
		return
	}
	defer s.Decref()

	log.Debug("Loading plugin %s", name)
	l := py.NewLock()
	defer l.Unlock()
	if r, err := module.Base().CallMethodObjArgs("reload_plugin", s); err != nil {
		log.Warn(err)
		return
	} else if r != nil {
		r.Decref()
	}
}
182251
func (c *edgeCollection) Load(ctx context.Context) error {
	if err := c.rawCollection().Load(ctx); err != nil {
		return WithStack(err)
	}
	return nil
}
469358
func (s *EventStore) Load(ctx context.Context, id uuid.UUID) ([]eh.Event, error) {
	s.dbMu.RLock()
	defer s.dbMu.RUnlock()

	// Ensure that the namespace exists.
	s.dbMu.RUnlock()
	ns := s.namespace(ctx)
	s.dbMu.RLock()

	aggregate, ok := s.db[ns][id]
	if !ok {
		return []eh.Event{}, nil
	}

	events := make([]eh.Event, len(aggregate.Events))
	for i, dbEvent := range aggregate.Events {
		events[i] = event{dbEvent: dbEvent}
	}

	return events, nil
}
510298
func (l *MemoryLoader) Load(name string) (Template, error) {
	v, ok := l.Templates[name]
	if !ok {
		return nil, os.ErrNotExist
	}
	return &stringTemplate{name, v}, nil
}
116403
func (e *Error) Load() error {
	v := e.v.Load()
	if v == nil {
		return nil
	}

	eh := v.(errorHolder)
	return eh.err
}
725885
func (cfg *Config) load(storage util.Storage) {
	if b, err := storage.Get("uuid"); err == nil && len(b) > 0 {
		cfg.id = string(b)
	}

	if b, err := storage.Get("version"); err == nil && len(b) > 0 {
		cfg.version = to.Int64(string(b))
	}

	if b, err := storage.Get("configHash"); err == nil && len(b) > 0 {
		cfg.configHash = b
	}
}
125219
func (m *SnapshotMetadata) load() error {
	// This is not safe for concurrent access.
	// Exported methods will deal with locking.
	jsonData, err := ioutil.ReadFile(m.path)
	if jsonData == nil || os.IsNotExist(err) {
		m.save()
	} else {
		if err := json.Unmarshal(jsonData, &m.snapshotMetadata); err != nil {
			return err
		}
	}
	return nil
}
1057721
func (m *EventStore) Load(ctx context.Context, id uuid.UUID) ([]eh.Event, error) {
	if m.Err != nil {
		return nil, m.Err
	}
	m.Loaded = id
	m.Context = ctx
	return m.Events, nil
}
232589
func (s *RediStore) load(session *sessions.Session) (bool, error) {
	conn := s.Pool.Get()
	defer conn.Close()
	if err := conn.Err(); err != nil {
		return false, err
	}
	data, err := conn.Do("GET", s.keyPrefix+session.ID)
	if err != nil {
		return false, err
	}
	if data == nil {
		return false, nil // no data was associated with this key
	}
	b, err := redis.Bytes(data, err)
	if err != nil {
		return false, err
	}
	return true, s.serializer.Deserialize(b, session)
}
755642
func (l *fsLoader) Load(ep *transport.Endpoint) (storer.Storer, error) {
	fs, err := l.base.Chroot(ep.Path)
	if err != nil {
		return nil, err
	}

	if _, err := fs.Stat("config"); err != nil {
		return nil, transport.ErrRepositoryNotFound
	}

	return filesystem.NewStorage(fs, cache.NewObjectLRUDefault()), nil
}
1133494
func (env *Env) load(name string) (*parse.Tree, error) {
	tpl, err := env.Loader.Load(name)
	if err != nil {
		return nil, err
	}
	tree := parse.NewNamedTree(name, tpl.Contents())
	tree.Visitors = append(tree.Visitors, env.Visitors...)
	err = tree.Parse()
	if err != nil {
		return nil, err
	}
	return tree, nil
}
153086
func Load() {
	pwd, _ := os.Getwd()
	goenv := os.Getenv("GOENV")
	envFile := ".env"

	if len(goenv) > 0 && goenv != "development" {
		envFile = fmt.Sprintf("%s.%s", envFile, goenv)
	}

	localFile := envFile + ".local"
	env.ReadEnv(path.Join(pwd, envFile))
	env.ReadEnv(path.Join(pwd, localFile))
}
669241
func (j *JSONLoader) Load(s interface{}) error {
	var r io.Reader
	if j.Reader != nil {
		r = j.Reader
	} else if j.Path != "" {
		file, err := getConfig(j.Path)
		if err != nil {
			return err
		}
		defer file.Close()
		r = file
	} else {
		return ErrSourceNotSet
	}

	return json.NewDecoder(r).Decode(s)
}