Coder Social home page Coder Social logo

file-store's Introduction

file-store

Simple file store service

This is a simple Go HTTP server that provides endpoints for storing, listing, removing, updating, counting words, and finding frequent words in uploaded files.

Setup:-

  1. Clone this repository:
  1. Navigate to repository
  • cd file-store
  1. Run the server.go
  • go run server.go

Endpoints:

  1. Add File POST /store/add
  • Add one or more files to the server's storage. Each file should be sent as a multipart form data with the key "file". Files are stored in the uploads/ directory.
  1. List Files GET /store/ls
  • List all files stored on the server.
  1. Remove File DELETE /store/rm?file=<file_name>
  • Remove a file from the server's storage. Provide the filename as a query parameter.
  1. Update File PUT /store/update?file=<file_name>
  • Update a file in the server's storage. Provide the filename as a query parameter and send the new file as multipart form data with the key "file".
  1. Word Count GET /store/wc
  • Count the total number of words across all uploaded files.
  1. Frequent Words GET /store/freq-words?limit=&order=<asc|desc>
  • List the most frequent words in uploaded files. You can specify the limit and order of the results.

Usage Example:

  1. Add a file:
  • ./store add file1.txt
  1. Update the file
  • ./store update file1.txt
  1. list the files
  • ./store ls
  1. Remove a file
  • ./store rm file1.txt
  1. Count the total words in a file
  • ./store wc
  1. Print the most frequent words
  • ./store freq-words

file-store's People

Contributors

nehalohia27 avatar

Watchers

 avatar

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.