GithubHelp home page GithubHelp logo

khargo's Introduction

Meet Khargo

Khargo is a Go (golang) HTTP file server with a GridFS (MongoDB) backend. If you want to store files in GridFS and serve them over HTTP, Khargo can help you out. It supports memory-efficient streaming of large files, and intelligent gzipping.

Running

Launch Khargo from the command line:

$ ./khargo 
2013/05/06 16:45:41 Connecting to mongodb://localhost:27017/test with strong consistency.
2013/05/06 16:45:41 Listening on :8000

Khargo accepts four command line arguments

Khargo does not daemonize.

The Khargo repository includes a Procfile that will launch Khargo as a 'web' proc. It expects $PORT and $DBURL environment variables to be set.

Compiling

Khargo is written in go. The only requirement outside the Go standard library is the mgo driver:

go get labix.org/v2/mgo
go build khargo.go

Logging

Khargo emits logs to stdout. Log lines look like this:

2013/05/06 15:05:03 10.0.2.2 - GET - /myfile.txt - curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5 -  - 200 - 14.024ms

That format is:

date time ip - method - path - user agent - referer - status - response time

Uploading Files

The 'mongo' command line client is usually also installed with a mongofiles utility that you can use to upload files to GridFS. Here's an example of using it to upload this README file, from one directory up:

mongofiles put README.rst --local khargo/README.rst -h mymongoserver --db myfilesdb

The Name

I previously created a Python program called Khartoum that could serve GridFS files over http. Khargo is a rewrite in Go.

khargo's People

Contributors

btubbs avatar berryp 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.