http

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func File added in v0.3.0

func File(url string, opts ...Option) error

File downloads file and unpack, pick files. Default: dest is local current directory.

func JsonString added in v0.5.0

func JsonString(url, pattern string) (string, error)

JsonString is requests RESTful API then returns the response parsed value (string). https://pkg.go.dev/github.com/tidwall/gjson#readme-path-syntax

Types

type Option

type Option func(*option)

Option represents unpack, pick files option.

func WithDir

func WithDir(dir string) Option

WithDir represents downloads file local location option. Default dest is current directory('.').

func WithPick

func WithPick(files ...string) Option

WithPick represents downloads file inner pick option.

func WithPickRename

func WithPickRename(pick map[string]string) Option

WithPickRename represents downloads file inner pick and rename option.

func WithRename

func WithRename(rename string) Option

WithRename represents downloads file local rename option.

type Result added in v0.5.0

type Result = gjson.Result

Result represents a json value that is returned from Json(). https://pkg.go.dev/github.com/tidwall/gjson#readme-result-type

func Json added in v0.3.0

func Json(url, pattern string) (Result, error)

Json is requests RESTful API then returns the response parsed value. https://pkg.go.dev/github.com/tidwall/gjson#readme-path-syntax

Jump to

Keyboard shortcuts

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