atomic

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 6 Imported by: 1

README

atomic ⚡️

Just a safe and better http-to-curl for golang

atomic is a plugin which is used to print curl for your HTTP requests, in pre-flight scenarios. The word safe is used here, as atomic implements a naïve technique to protect sensitive request pointers.

How to get started ?

  1. Import atomic in your code.

    go get github.com/Kieraya/atomic
    
  2. Add the following to your code.

    ...
        request, err := http.NewRequest(http.MethodGet, url, nil)
        // handle error
        curl, err := atomic.Boom(request)
        if err != nil {
            log.Println(err)
        }
        log.Println(curl)
    ..
    

    That's it ! You should see something like this:

    curl --location --request GET 'https://reqres.in/api/users?page=2' --header 'x-panem-token: BUM99779r42aUZUZB8Z95YLK'
    

Thanks and have fun. Happy hacking !

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Boom

func Boom(request *http.Request) (string, error)

Boom take *http.Request and provides string giving a curl for in-usage request

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL