Giter VIP home page Giter VIP logo

dcr's Introduction

DNS Cache Resolver (dcr)

Build Status Go Report Card GoDoc

dcr is a simple library to resolve and cache URLs from hostbased naming convention to IP based one. For instance, if you have an URL like http://www.google.com and would like to resolve it into IP based URL this library will help you, e.g.

// set DNSManager
var mgr DNSManager
host := "www.google.com"
rurl := fmt.Sprintf("http://%s/", host)

// resolve given URL
ipUrl := mgr.Resolve(rurl)

// print existing cache content
fmt.Println(mgr.String())

{"http://www.google.com/":["http://172.217.6.228/","http://[2607:f8b0:4006:802::2004]/"]}

Use-cases

In service like applications where code needs to deal with lots of similart URLs it is handy to define local cache of their IP representations without going through DNS server. For example, in web server where you need to handle multiple URLs at high rate and all of those URLs have a small set of unique hostnames, it is beneficial to resolve and cache theose URLs to avoid flood of requests to DNS server

dcr's People

Contributors

vkuznet avatar

Watchers

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