Code Monkey home page Code Monkey logo

file-monitoring-service's Introduction

How To Run: update config.json with appropriate configuration go run cmd/main.go

How To Monitor output file real time: ./__scripts/monitor_json.sh

TODO:

Format all loggers add test cases review delete use case ( right now making size to zero) review batch process and optimize if necessary Currently it supports base and subfolders monitoring Error handling - error tracking

Notes:

  1. identify the polling library,

  2. /config/config.json { "sourceDir":"/tmp", "reportDir":"/tmp/out", "maxGoroutines": 2 }

    -- gather 1: { {"file":size},

    }

    { { "key:"filename, size:int } }

    new file, update file determine the state - system time , updated ts vs created ts maintain previous run time , determine previously created value either overwrite or update meta-data : last run time , last status.

    libraries : https://github.com/fsnotify/fsnotify/blob/main/README.md

    log library : TODO://

    loadConfig() err

    init()

    updateStatus() err

    getSize()int

ref material/links :

ref: https://go.dev/blog/pipelines https://stackoverflow.com/questions/52512915/how-to-solve-concurrency-access-of-golang-map https://stackoverflow.com/questions/25306073/always-have-x-number-of-goroutines-running-at-any-time https://www.pixelstech.net/article/1677371161-What-is-the-use-of-empty-struct-in-GoLang

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.