utils

package
v0.0.0-...-8684de4 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertError

func ConvertError(err error) error

ConvertError converts generic HTTP error in JSON format returned by Pipeline API

func ReadFileOrStdin

func ReadFileOrStdin(filename string) (fname string, raw []byte, err error)

func Unmarshal

func Unmarshal(raw []byte, data interface{}) error

Types

type CurlCommand

type CurlCommand []string

CurlCommand contains exec.Command compatible slice + helpers

func GetCurlCommand

func GetCurlCommand(req *http.Request, insecureSkipVerify bool) (*CurlCommand, error)

GetCurlCommand returns a CurlCommand corresponding to an http.Request

func (*CurlCommand) String

func (c *CurlCommand) String() string

String returns a ready to copy/paste command

Jump to

Keyboard shortcuts

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