Documentation ¶
Overview ¶
Package pastehere implements a pastebin-like application.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Home ¶
func Home(resp http.ResponseWriter, req *http.Request)
Home displays pastehere's homepage.
func Paste ¶
func Paste(resp http.ResponseWriter, req *http.Request)
Paste receives a new paste from a client.
func Register ¶
Register registers HTTP handlers for pastehere.
Example ¶
package main import ( "flag" "log" "net/http" "github.com/remyoudompheng/go-misc/pastehere" ) var address string func init() { flag.StringVar(&address, "http", ":8080", "listen address") } func main() { flag.Parse() if address == "" { flag.Usage() return } log.Printf("start listening at %s", address) pastehere.Register(nil) err := http.ListenAndServe(address, nil) if err != nil { log.Fatal(err) } }
Output:
Types ¶
Click to show internal directories.
Click to hide internal directories.