// SimpleFSFolderEditHistory implements the SimpleFSInterface.
769612
func (s *SimpleFSHandler) SimpleFSFolderEditHistory(
	ctx context.Context, path keybase1.Path) (
	res keybase1.FSFolderEditHistory, err error) {
	ctx, cancel := s.wrapContextWithTimeout(ctx)
	defer cancel()
	cli, err := s.client()
	if err != nil {
		return keybase1.FSFolderEditHistory{}, err
	}
	return cli.SimpleFSFolderEditHistory(ctx, path)
}
562237
func (p *StatsProvider) HasDedicatedImageFs() (bool, error) {
	device, err := p.containerStatsProvider.ImageFsDevice()
	if err != nil {
		return false, err
	}
	rootFsInfo, err := p.cadvisor.RootFsInfo()
	if err != nil {
		return false, err
	}
	return device != rootFsInfo.Device, nil
}
357082
func (c SimpleFSClient) SimpleFSCopyRecursive(ctx context.Context, __arg SimpleFSCopyRecursiveArg) (err error) {
	err = c.Cli.Call(ctx, "keybase.1.SimpleFS.simpleFSCopyRecursive", []interface{}{__arg}, nil)
	return
}
1330864
func SetHistoryPath(fp string) {
	ins := getInstance()
	cfg := ins.Config.Clone()
	cfg.HistoryFile = fp
	ins.SetConfig(cfg)
}
221874
func (c *Client) GetIGFolders() (Refs, error) {
	igFolders, err := c.api.GetIGFolders()
	if err != nil {
		return nil, err
	}
	return igFolders.Folders, nil
}
421876
func ImageHistory(id string) (histories []image.HistoryResponseItem, err error) {
	var (
		ctx context.Context
		cli *client.Client
	)
	if ctx, cli, err = mgr.Client(); err == nil {
		return cli.ImageHistory(ctx, id)
	}
	return
}
393629
func (k *SimpleFS) SimpleFSSetFolderSyncConfig(
	ctx context.Context, arg keybase1.SimpleFSSetFolderSyncConfigArg) error {
	ctx = k.makeContext(ctx)
	tlfID, _, err := k.getSyncConfig(ctx, arg.Path)
	if err != nil {
		return err
	}

	_, err = k.config.KBFSOps().SetSyncConfig(ctx, tlfID, arg.Config)
	return err
}
86277
func (f *Favorites) sendChangesToEditHistory(oldCache map[favorites.Folder]favorites.Data) {
	for oldFav := range oldCache {
		if _, present := f.favCache[oldFav]; !present {
			f.config.UserHistory().ClearTLF(tlf.CanonicalName(oldFav.Name),
				oldFav.Type)
		}
	}
	for newFav := range f.favCache {
		if _, present := oldCache[newFav]; !present {
			f.config.KBFSOps().RefreshEditHistory(newFav)
		}
	}
}
1098008
func (w *wrapper) Folders() map[string]FolderConfiguration {
	w.mut.Lock()
	defer w.mut.Unlock()
	if w.folderMap == nil {
		w.folderMap = make(map[string]FolderConfiguration, len(w.cfg.Folders))
		for _, fld := range w.cfg.Folders {
			w.folderMap[fld.ID] = fld.Copy()
		}
	}
	return w.folderMap
}
846086
func WriteArchive(name string, files []string) (err error) {
	archfd, err := os.Create(name)
	if err != nil {
		return err
	}

	defer func() {
		archfd.Close()
		// Remove the half-written archive on failure.
		if err != nil {
			os.Remove(name)
		}
	}()
	archive, basename := NewArchive(archfd)
	if archive == nil {
		return fmt.Errorf("unknown archive extension")
	}
	fmt.Println(name)
	if err := archive.Directory(basename); err != nil {
		return err
	}
	for _, file := range files {
		fmt.Println("   +", filepath.Base(file))
		if err := AddFile(archive, file); err != nil {
			return err
		}
	}
	return archive.Close()
}
472391
func NewHistoryOfSize(filename string, size int) (*history, error) {
	if size <= 0 {
		return nil, errors.New("wrong history size: " + strconv.Itoa(size))
	}

	return _baseHistory(filename, size)
}
1075926
func (s *SimpleFSHandler) SimpleFSOpen(ctx context.Context, arg keybase1.SimpleFSOpenArg) error {
	ctx, cancel := s.wrapContextWithTimeout(ctx)
	defer cancel()
	cli, err := s.client()
	if err != nil {
		return err
	}
	return cli.SimpleFSOpen(ctx, arg)
}
978706
func (k *SimpleFS) SimpleFSUserEditHistory(ctx context.Context) (
	res []keybase1.FSFolderEditHistory, err error) {
	session, err := idutil.GetCurrentSessionIfPossible(
		ctx, k.config.KBPKI(), true)
	// Return empty history if we are not logged in.
	if err != nil {
		return nil, nil
	}
	return k.config.UserHistory().Get(string(session.Name)), nil
}
242777
func (b *BigIP) Folders() (*Folders, error) {
	var folders Folders
	err, _ := b.getForEntity(&folders, uriSys, uriFolder)
	if err != nil {
		return nil, err
	}

	return &folders, nil
}
348811
func (k *SimpleFS) SimpleFSReset(
	ctx context.Context, path keybase1.Path) error {
	t, tlfName, _, _, err := remoteTlfAndPath(path)
	if err != nil {
		return err
	}
	tlfHandle, err := libkbfs.GetHandleFromFolderNameAndType(
		ctx, k.config.KBPKI(), k.config.MDOps(), k.config, tlfName, t)
	if err != nil {
		return err
	}

	return k.config.KBFSOps().Reset(ctx, tlfHandle)
}
750706
func (u *ListFolderResult) UnmarshalJSON(b []byte) error {
	type wrap struct {
		// Entries : The files and (direct) subfolders in the folder.
		Entries []json.RawMessage `json:"entries"`
		// Cursor : Pass the cursor into `listFolderContinue` to see what's
		// changed in the folder since your previous query.
		Cursor string `json:"cursor"`
		// HasMore : If true, then there are more entries available. Pass the
		// cursor to `listFolderContinue` to retrieve the rest.
		HasMore bool `json:"has_more"`
	}
	var w wrap
	if err := json.Unmarshal(b, &w); err != nil {
		return err
	}
	u.Entries = make([]IsMetadata, len(w.Entries))
	for i, e := range w.Entries {
		v, err := IsMetadataFromJSON(e)
		if err != nil {
			return err
		}
		u.Entries[i] = v
	}
	u.Cursor = w.Cursor
	u.HasMore = w.HasMore
	return nil
}
1077111
func (s *SimpleFSHandler) SimpleFSReset(
	ctx context.Context, path keybase1.Path) (err error) {
	ctx, cancel := s.wrapContextWithTimeout(ctx)
	defer cancel()
	cli, err := s.client()
	if err != nil {
		return err
	}
	return cli.SimpleFSReset(ctx, path)
}