snivilised / extendio Goto Github PK
View Code? Open in Web Editor NEW🐋 extentions to Go standard io library
License: MIT License
🐋 extentions to Go standard io library
License: MIT License
Current, filters are defined in the config as a object that sits behind an interface. This form make them impossible to serialise. The config should be changed to represent filters in a serialisable form, so they should be configured with the properties of the filters rather than an object. But we still need to allow for a custom filter. For custom filters, it would be up to the client to implement the corresponding restore functionality for the resume feature.
The complication we have is with the listen feature. We need to accept the listen conditions from the parent and apply it appropriately for the sub tree. All we need to do is ensure we initialise to the same state that the parent was already in and just continue.
In order to do this, we need to persist and restore that listen state.
NB: the navigationListener definition:
type navigationListener struct {
listen ListeningState
states navigationListeningStates
current TraverseCallback
}
needs to be refactored a little: listen->state, current->callback
add an indication to show the depth of the naviagtion relative to the specified root
See hyperfine
Here's an example of benchmarking (from deep-copy-object-with-reflecting-or-gob-in-go):
go test -v -run=^$ -bench=. -benchtime=10s -cpuprofile=prof.cpu -memprofile=prof.mem -memprofilerate=2
(the fake version can be used to practice the auto release process without polluting this repo with mistake commits. Make sure to create the copy that includes the commit history (ie fork), so there is some commit data to work with)
Take a look at:
If the filter is not applicable to a particular file system node, should that node be invoked or not? If you define a filter which contains a discriminating scope (ie not all nodes), does it not make sense that the callback should NOT be invoked? On first thoiught it seems that this should be the case, but it may not suit all scenarios, so this should become aconfigurable filter behaviour. By default, a filter that is not applicable, will not allow that node to be invoked for.
will initially contains exists functionality. Will be used to contain any file system related util functionality
the term 'interfaces' shouldn't be taken literally, it just means the client interface into the traverse functionality. This can include the options obect the client needs to define subscription.
add the traversal metrics
a node may be top and leaf, but not properly accounted for
also fix up a file only be a leaf if all its siblings are files too
allows custom sorting and filtering
Need a notification that indicates that current directory notification represents a leaf directory
some notes I made:
ROOT:. 💔 (C:\Users\Plastikfan\dev\github\PoSh\Utopia\Elizium.Utopia)
├───.vscode
├───Classes
├───Internal
├───Output
│ └───Elizium.Utopia
├───Public
│ ├───ez
│ ├───fs
│ ├───git
│ ├───loopz
│ ├───qfs
│ ├───rez
│ ├───tools
│ ├───ui
│ └───yank
└───Tests 💔
├───Data 💔
│ ├───Arcadia
│ │ ├───C
│ │ │ └───Charli XCX
│ │ │ ├───aka
│ │ │ │ └───Charlotte Aitchison
│ │ │ │ └───Atlantic
│ │ │ │ ├───Boom Clap
│ │ │ │ └───How I'm Feeling Now
│ │ │ ├───Asylum Records
│ │ │ │ ├───Sucker
│ │ │ │ └───True Romance
│ │ │ └───This Is Music
│ │ │ ├───Nuclear Seasons
│ │ │ └───Super Ultra
│ │ ├───P
│ │ │ └───Plastikman
│ │ │ ├───aka
│ │ │ │ └───FUSE
│ │ │ │ └───Nova
│ │ │ │ ├───Computer Space
│ │ │ │ └───Dimension Intrusion
│ │ │ │ ├───Part One
│ │ │ │ └───Part Two
│ │ │ ├───Mute
│ │ │ │ └───Spastik
│ │ │ └───Plus8 ➕
│ │ │ ├───Krakpot
│ │ │ └───Plastique
│ │ └───S
│ │ └───Speedy J
│ │ └───aka
│ ├───infexion
│ └───MUSICO 💔
│ ├───bass
│ │ ├───DUB
│ │ │ ├───Dreadzone
│ │ │ │ └───Second Light
│ │ │ └───Leftfield
│ │ │ ├───Alternative Light Source
│ │ │ ├───Leftism 22
│ │ │ └───Tourism
│ │ └───DUBSTEP
│ │ └───Katy B
│ │ ├───Honey
│ │ └───Little Red
│ ├───DREAM-POP
│ │ ├───Cocteau Twins
│ │ │ └───Heaven Or Las Vegas
│ │ ├───Kate Bush
│ │ │ ├───Hounds of Love
│ │ │ └───The Sensual World
│ │ └───Tori Amos
│ │ ├───Little Earthquakes
│ │ └───Strange Little Girls
│ ├───edm 💔
│ │ ├───AMBIENT-TEHNO
│ │ │ ├───Amorphous Androgynous
│ │ │ │ └───Tales Of Ephidrina
│ │ │ ├───Aphex Twin
│ │ │ │ ├───Classics
│ │ │ │ └───Selected Ambient Works 85-92
│ │ │ └───Polygon Window
│ │ │ └───Surfing on Sine Waves
│ │ ├───ELECTRONICA 💔
│ │ │ ├───Orbital 💔 ➕ (current changes 💚)
│ │ │ │ ├───Diversions
│ │ │ │ ├───In Sides ❤️ RESUME FROM HERE
│ │ │ │ ├───Orbital ⭕
│ │ │ │ ├───Orbital 2 ⭕
│ │ │ │ ├───Snivilisation ⭕
│ │ │ │ └───Wonky ⭕
│ │ │ ├───The Chemical Brothers
│ │ │ │ ├───Exit Planet Dust
│ │ │ │ └───No Geography
│ │ │ └───Underworld
│ │ │ ├───Beaucoup Fish
│ │ │ ├───Dubnobasswithmyheadman
│ │ │ ├───Pearl's Girl
│ │ │ └───Second Toughest in the Infants
│ │ └───MINMAL-TECHNO
│ │ ├───FUSE
│ │ │ ├───Dimension Intrusion
│ │ │ └───Train Trac
│ │ └───Plastikman
│ │ ├───Closer
│ │ ├───Consumed
│ │ ├───Musik
│ │ └───Sheet One
│ ├───ELECTRONIC-POP
│ │ ├───Depeche Mode
│ │ │ ├───I Feel You
│ │ │ └───Remixes 81-04
│ │ └───Traci Lords
│ │ ├───1000 Fires
│ │ ├───Control (Single)
│ │ └───Fallen Angel (Single)
│ ├───POP
│ │ ├───Katy Perry
│ │ │ └───Teenage Dream
│ │ └───Madonna
│ │ ├───Bedtime Stories
│ │ ├───Confessions on a Dance Floor
│ │ ├───Like a Virgin
│ │ ├───Madonna
│ │ │ ├───Covers
│ │ │ └───Signal
│ │ ├───Material Girl (Vinyl Single)
│ │ │ └───Signal
│ │ ├───MDNA
│ │ └───Music
💔 = Fractured ancestor, caused by resume
ROOT-PATH: C:\Users\Plastikfan\dev\github\PoSh\Utopia\Elizium.Utopia
RESUME-FROM: C:\Users\Plastikfan\dev\github\PoSh\Utopia\Elizium.Utopia\Tests\Data\MUSICO\edm\ELECTRONICA\Orbital\In Sides
The NET-PATH is RESUME - ROOT: "Tests\Data\MUSICO\edm\ELECTRONICA\Orbital\In Sides"
So from "In Sides", proceed as follows:
Just to illustrate how directory walking works using the standard io.fs version of walkdir. Will require the adding of test directory tree.
This is largely an exploratory task, defining comprehension tests to check how existing filepath functionality works.
If a client needs to override ReadDirectory to optimise for performance reasons, the handling of file or folder entries needs to be made clearer. An anticipated optimisation is that to do with stripping out all file entries. Currently, it is thought that the existing design will not correctly allow for this to be done effectively, so an internal refactor may be required.
As a starting point, we can define a new ReadDirectory that only returns folder entries.
Actually, if #47 is implemented, then this refactor issue may be a moot point.
only collates directory entries and omits all files.
Before you go all in on this read: If this code could walk and see this lib: godirwalk
This cli bench-marking tool may also be of interest: hyperfine
Dont implement this until near to release time, as there will probably be more items to addto this list
delete FilterInfo
hook function filenames should be named hook-XXXX.go eg hook-extend.go
change (&nav.NavigatorFactory{}).Create
, by defining a package global instance of the factory, so the client can invoke Create with Factory.Create
, which is neater.
there are some items which are exported which do not need to be. Note that internal classes with exported methds are ok because required for testing.
It might be better to do this in a separate repo to avoid potential circular dependencies.
must be able to filter with regex or glob, both negative and positive (polarity)
function callbacks on option, will not be persistable, so need to all the client to reset them
Walk a directory tree, but only start invoking the callback, once a certain predicate has been satisfied and then stop when another predicate is satisfied, ie traverse with start-predicate and end-predicate.
Can be implemented by defining a decorator function that wraps the client defined callback. The decorator would be provided with the navigation frame that will help it to determine when to start and stop invoking the client callback.
Need the following items:
Create the necessary functionality required by the client in order to launch a resume operation. The resume will need to have a way of creating a new blank navigator that will load state from json previously persisted. After the state has been marshalled in, the navigator impl needs to be created and re-initialised according to that state.
Need to also save the current item being processed somewhere in the frame so we know where to resume from next time. That will have to be stored in the marshalled state too.
When only folders are requested, there may be a need to obtain its file children in a single entity, rather than navigating them. ie we only want the folders, but in this mode, when the client gets called back, there is also a collection property provided that contains the files. We cna also define an alterntive filter speificially for the files.
This means we need to redefine the filter section so it accomodate another filter. (Filters.Current, FIlters.Children)
LocalisableError is universally applicable across extendio
There are multiple generic solutions currently available to achieve this but they are either deficient in some way or do not have a properly tagged and stable released version, therefore this will be done in a specilaised way in-house.
Current, filters are defined in the config as a object that sits behind an interface. This form make them impossible to serialise. The config should be changed to represent filters in a serialisable form, so they should be configured with the properties of the filters rather than an object. But we still need to allow for a custom filter. For custom filters, it would be up to the client to implement the corresponding restore functionality for the resume feature.
coverage path not set correctly
move Filter to Filters.Current
Allow client t define whether folders or files are navigated first. Add a boolean option (FilesFirst) to SortBehaviours. The default behaviour is the zero value of false, meaning that folders will be navigated first.
The issue #52 was probably implemented incorrectly. Instead of persisting options, we should have persisted navigation state, where the options are just part of this overall state, so this issue will fix that.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.