cian911 / switchboard Goto Github PK
View Code? Open in Web Editor NEWAuto-magic file organisation and routing for all your machines. :open_file_folder:
Home Page: https://goswitchboard.io/
License: MIT License
Auto-magic file organisation and routing for all your machines. :open_file_folder:
Home Page: https://goswitchboard.io/
License: MIT License
On Linux, manually polling is not needed. Have you looked into inotifywait or something like https://github.com/xyproto/recwatch?
Switchboard is a neat idea!
As a user, I want to be able to configure and watch for specific event types. For example, I should have the ability to watch for CREATE
events specifically that match a file extension/pattern, or DELETE
events as example.
Allow user to specify regex pattern of a file/event to watch for.
panic: non-positive interval for NewTicker
The latest version of fsnotify
is 1.7.0
yet switchboard is a custom version on github.com/Cian911/fsnotify v1.5.2-0.20220220230351-4d6a6a3b3090
.
We should update to the latest version in our custom fork to reap the benefits of recent updates. This should be replicated to pro
as well.
Each watcher should have a changeable priority which would denote which watcher should process an event in the case that multiple watchers match the same event. Take the example below.
I have the following config for switchboard:
pollingInterval: 10
watchers:
- path: "/home/cian/Downloads"
destination: "/home/cian/Documents"
ext: ".txt"
- path: "/home/cian/Downloads"
destination: "/home/cian/Documents/Reports"
ext: ".txt"
pattern: "(?i)(financial-report-[a-z]+-[0-9]+.txt)"
- path: "/home/cian/Downloads"
destination: "/home/cian/Videos"
ext: ".mp4"
In the event that I save a txt
file that matches the first two watchers, we encounter a race condition between the two as to which will process the event first.
I propose adding a priority attribute to switchboard which will denote the order in which events should be processed by watchers, should multiple watchers be capable of matching the same event. A new config might look like this:
pollingInterval: 10
watchers:
- path: "/home/cian/Downloads"
destination: "/home/cian/Documents"
ext: ".txt"
priority: 1
- path: "/home/cian/Downloads"
destination: "/home/cian/Documents/Reports"
ext: ".txt"
pattern: "(?i)(financial-report-[a-z]+-[0-9]+.txt)"
priority: 2
1
in this case should be the lowest priority, which all watcher will default to, and a higher priority ascending from that 2, 3, 4...
When a folder is created in a watched directory, it does not trigger an expected event, even though the folder contains the watched file type.
Add support for conditional logging - User should be able to choose the log level they want for switchboard via a flag passed to the watch command.
As example:
switchboard watch --config -log verbose
Loging should be disabled by default otherwise - this remove all the noise when being run.
Add test case for this too in specs.
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.