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 (*URL) IsHTTPOrHTTPS ¶
IsHTTPOrHTTPS returns true if u is http or https
func (*URL) MarshalJSON ¶
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 ¶
SetHeaders sets headers to req according to u and ac configs.
func (*URL) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaller interface. required to properly clone internal representation of url