Coder Social home page Coder Social logo

psaia / dwarf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from levinteractive/dwarf

0.0 2.0 0.0 65 KB

Just another O(1) URL shortener service. Go + Redis + gRPC.

Home Page: https://hub.docker.com/r/levinteractive/dwarf/

Dockerfile 2.50% Go 94.42% Shell 3.08%

dwarf's Introduction

Dwarf

A performant URL shortener written in Go using a Redis as a store while exposing an interface for others. Uses gRPC for communication for high throughput.

How it works

GET /{short-hash}

This will result in a 301 redirect or a 404 not found.

Creating new shortened URL's via gRPC

service Dwarf {
	rpc Create(CreateRequest) returns (CreateResponse) {}
}

message CreateRequest {
	repeated string urls = 1;
}

message CreateResponse {
	repeated string urls = 2;
}

Your response will return a set of shortened urls in the same order:

{
  "urls": ["http://sh.ort/Mp", "http://sh.ort/uJ"]
}

A way to interface with this is by using this node client.

Development

Redis Store

Spin up an instance of redis with:

docker run -p "6379:6379" --rm --name dwarf-redis redis:4-alpine

Testing

go test github.com/LevInteractive/dwarf/ -v

Note that the tests relies on a running redis instance.

dwarf's People

Contributors

psaia avatar rafaelgou avatar

Watchers

 avatar James Cloos 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.