Documentation
      ¶
    
    
  
    
  
    Index ¶
Constants ¶
This section is empty.
Variables ¶
      View Source
      
  var HTTPListenAndServe = http.ListenAndServe
    Indirections for easier testing (do not change runtime behavior)
      View Source
      
  
    var HTTPServe = http.Serve
    
      View Source
      
  
    var NgrokListen = func(ctx context.Context, epOpts []config.HTTPEndpointOption, connectOpts []ngrok.ConnectOption) (ListenerWithURL, error) { return ngrok.Listen(ctx, config.HTTPEndpoint(epOpts...), connectOpts...) }
      View Source
      
  var ServeLocalFunc = func(addr string, mux http.Handler) error { return HTTPListenAndServe(addr, mux) }
serveLocalFunc starts a local HTTP server. Overridable in tests.
      View Source
      
  var ServeNgrokFunc = func(ctx context.Context, epOpts []config.HTTPEndpointOption, connectOpts []ngrok.ConnectOption, mux http.Handler) error { ln, err := NgrokListen(ctx, epOpts, connectOpts) if err != nil { return err } log.Printf("%s[INFO]%s Public URL: %s", colorGreen, colorReset, ln.URL()) log.Printf("%s[INFO]%s All incoming requests will be printed below. Press Ctrl+C to stop.", colorGreen, colorReset) return HTTPServe(ln, mux) }
serveNgrokFunc starts an ngrok listener and serves HTTP on it. Overridable in tests.
Functions ¶
func ColorMethod ¶
func LoadDotEnv ¶
func LoadDotEnv(path string)
func SaveEnvVar ¶
saveEnvVar upserts a KEY=VALUE line into the given .env file.
func TryPrettyJSON ¶
func WebhookHandler ¶
func WebhookHandler(w http.ResponseWriter, r *http.Request)
Types ¶
type ListenerWithURL ¶
 Click to show internal directories. 
   Click to hide internal directories.