Documentation ¶
Index ¶
- type URL
- func (u *URL) GetURL() *url.URL
- func (u *URL) IsHTTPOrHTTPS() bool
- func (u *URL) MarshalJSON() ([]byte, error)
- func (u *URL) MarshalYAML() (any, error)
- func (u *URL) NewDialFunc(ac *promauth.Config) (func(ctx context.Context, network, addr string) (net.Conn, error), error)
- func (u *URL) SetHeaders(ac *promauth.Config, req *http.Request) error
- func (u *URL) String() string
- func (u *URL) UnmarshalJSON(b []byte) error
- func (u *URL) UnmarshalYAML(unmarshal func(any) error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type URL ¶
URL implements YAML.Marshaler and yaml.Unmarshaler interfaces for url.URL.
func MustNewURL ¶ added in v1.56.0
MustNewURL returns new URL for the given u.
func (*URL) IsHTTPOrHTTPS ¶ added in v1.58.0
IsHTTPOrHTTPS returns true if u is http or https
func (*URL) MarshalJSON ¶ added in v1.97.7
MarshalJSON implements json.Marshal interface. required to properly clone internal representation of url
func (*URL) MarshalYAML ¶
MarshalYAML implements yaml.Marshaler interface.
func (*URL) NewDialFunc ¶
func (u *URL) NewDialFunc(ac *promauth.Config) (func(ctx context.Context, network, addr string) (net.Conn, error), error)
NewDialFunc returns dial func for the given u and ac. Dial uses HTTP CONNECT for http and https targets https://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_method And socks5 for socks5 targets https://en.wikipedia.org/wiki/SOCKS supports authorization and tls configuration
func (*URL) SetHeaders ¶ added in v1.79.0
SetHeaders sets headers to req according to u and ac configs.
func (*URL) UnmarshalJSON ¶ added in v1.97.7
UnmarshalJSON implements json.Unmarshaller interface. required to properly clone internal representation of url