utils

package
v0.0.0-...-48bbbdf Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StartDelimiter = '{'
	EndDelimiter   = '}'
)

Variables

View Source
var StopRedirect = func(_ *http.Request, _ []*http.Request) error {
	return http.ErrUseLastResponse
}

Functions

func GetCred

func GetCred(prov string) (string, bool)

func Must

func Must(err error)

func SetCred

func SetCred(prov, cred string)

func TransposeHeader

func TransposeHeader(header http.Header, keys ...string) (ret http.Header)

func TransposeValues

func TransposeValues(values url.Values, keys ...string) (ret url.Values)

Types

type Client

type Client struct {
	http.Client
	Header http.Header
}

func NewClient

func NewClient() *Client

func (*Client) Do

func (c *Client) Do(req *http.Request) (*http.Response, error)

func (*Client) DoJSON

func (c *Client) DoJSON(req *http.Request, v interface{}) (*http.Response, error)

type FMap

type FMap map[string]string

func (FMap) Set

func (f FMap) Set(key, value string)

func (FMap) SetFunc

func (f FMap) SetFunc(key string, strfunc func() string)

func (FMap) Setf

func (f FMap) Setf(key, format string, values ...interface{})

type FormatString

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

func NewFormatString

func NewFormatString(inp string) *FormatString

func (*FormatString) Format

func (f *FormatString) Format(fmap FMap) string

func (*FormatString) UnmarshalText

func (f *FormatString) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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