src/client/pfs.go
func (c APIClient) Walk(repoName string, commitID string, path string, f WalkFn) error {
	fs, err := c.PfsAPIClient.WalkFile(
		c.Ctx(),
		&pfs.WalkFileRequest{File: NewFile(repoName, commitID, path)})
	if err != nil {
		return grpcutil.ScrubGRPC(err)
	}
	for {
		fi, err := fs.Recv()
		if err == io.EOF {
			return nil
		} else if err != nil {
			return grpcutil.ScrubGRPC(err)
		}
		if err := f(fi); err != nil {
			if err == errutil.ErrBreak {
				return nil
			}
			return err
		}
	}
}
func (c APIClient) Walk(repoName string, commitID string, path string, f WalkFn) error {
	fs, err := c.PfsAPIClient.WalkFile(
		c.Ctx(),
		&pfs.WalkFileRequest{File: NewFile(repoName, commitID, path)})
	if err != nil {
		return grpcutil.ScrubGRPC(err)
	}
	for {
		fi, err := fs.Recv()
		if err == io.EOF {
			return nil
		} else if err != nil {
			return grpcutil.ScrubGRPC(err)
		}
		if err := f(fi); err != nil {
			if err == errutil.ErrBreak {
				return nil
			}
			return err
		}
	}
}
func ( c APIClient ) Walk ( repoName string , commitID string , path string , f WalkFn ) error { fs , err := c . PfsAPIClient . WalkFile ( c . Ctx ( ) , & pfs . WalkFileRequest { File : NewFile ( repoName , commitID , path ) } ) if err != nil { return grpcutil . ScrubGRPC ( err ) } for { fi , err := fs . Recv ( ) if err == io . EOF { return nil } else if err != nil { return grpcutil . ScrubGRPC ( err ) } if err := f ( fi ) ; err != nil { if err == errutil . ErrBreak { return nil } return err } } }
// Walk walks the pfs filesystem rooted at path. walkFn will be called for each
// file found under path in lexicographical order. This includes both regular
// files and directories.
Walk walks the pfs filesystem rooted at path . walkFn will be called for each file found under path in lexicographical order . This includes both regular files and directories .