curlcolor

package module
v0.0.0-...-7faf406 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

README

curlcolor

Color curl's output

  • error handle
  • support more schemes
  • support -v option

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFormatType

func GetFormatType(contentType string, filename string) string

func GetUrlScheme

func GetUrlScheme(url string) string

func NewVerboseChannelIterator

func NewVerboseChannelIterator(source chan string) chroma.Iterator

func ParseAndPrintError

func ParseAndPrintError(mgr *Manager, errReader io.Reader) error

func ParseAndPrintOutput

func ParseAndPrintOutput(mgr *Manager, output io.Reader) error

func ParseResponse

func ParseResponse(text []byte, url string) (*http.Response, error)

func Run

func Run(argv []string) error

func SplitHeader

func SplitHeader(respBF *bufio.Reader) ([]byte, error)

func TraversalSearchBool

func TraversalSearchBool(key string, argv []string, default2 bool) (bool, []string, error)

func TraversalSearchString

func TraversalSearchString(key string, argv []string, default2 string) (string, []string, error)

Types

type ArgType

type ArgType int
const (
	ArgNone ArgType = iota
	ArgBool
	ArgString
	ArgFilename
)

type ColorPrinter

type ColorPrinter struct {
	OutWriter io.Writer
	ErrWriter io.Writer
	Formatter string
	Theme     string
}

func (*ColorPrinter) Highlight

func (c *ColorPrinter) Highlight(text []byte, lexer string)

func (*ColorPrinter) VerboseChannelFormat

func (c *ColorPrinter) VerboseChannelFormat(text chan string) error

type CurlParam

type CurlParam struct {
	// contains filtered or unexported fields
}

func (*CurlParam) SetVal

func (p *CurlParam) SetVal(argv []string) ([]string, error)

type CurlParameter

type CurlParameter map[string]*CurlParam

func ParseArgs

func ParseArgs(argv []string) (CurlParameter, error)

func (*CurlParameter) Get

func (p *CurlParameter) Get(key string) (*CurlParam, bool)

func (*CurlParameter) GetBool

func (p *CurlParameter) GetBool(key string) bool

func (*CurlParameter) GetString

func (p *CurlParameter) GetString(key string) string

type Manager

type Manager struct {
	CurlParameter CurlParameter
	Printer       ColorPrinter
	Debug         bool
	CurlCmd       string
	Version       bool
}

func ResolveManager

func ResolveManager(args []string) (*Manager, []string, error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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