github.com/aarzilli/tools@v0.0.0-20151123112009-0d27094f75e0/big_query/register_handlers.go (about)

     1  package big_query
     2  
     3  import (
     4  	"net/http"
     5  
     6  	"github.com/pbberlin/tools/net/http/loghttp"
     7  	"github.com/pbberlin/tools/net/http/tplx"
     8  )
     9  
    10  func ViewHTML(w http.ResponseWriter, r *http.Request, m map[string]interface{}) {
    11  
    12  	b1, ml := disLegend(w, r)
    13  	_ = b1
    14  
    15  	add, tplExec := tplx.FuncTplBuilder(w, r)
    16  
    17  	add("n_html_title", "The Battle of Computer Languages", "")
    18  
    19  	add("n_cont_0", tplx.PrefixLff+"chart_body", map[string]map[string]string{"legend": ml})
    20  	add("tpl_legend", tplx.PrefixLff+"chart_body_embed01", "")
    21  
    22  	add("n_cont_1", `<a 
    23  			target='openhub'
    24  			href='https://www.openhub.net/languages/compare?measure=loc_changed&percent=true&l0=-1&l1=golang&l2=php&l3=python&l4=ruby&l5=-1&commit=Update' 
    25  			>Here is a good comparison</a>`, "")
    26  
    27  	tplExec(w, r)
    28  
    29  }
    30  
    31  func init() {
    32  	http.HandleFunc("/big-query/html", loghttp.Adapter(ViewHTML))
    33  	http.HandleFunc("/big-query/test-gob-codec", loghttp.Adapter(testGobDecodeEncode))
    34  }