Documentation
¶
Overview ¶
package url provides url fuctionalities to provide consistent parsing for Kwil clients.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrUnknownScheme = errors.New("unknown scheme")
)
Functions ¶
Types ¶
type URL ¶
type URL struct {
// Original is the original URL string.
Original string
// Scheme is the protocol scheme, such as http or tcp.
Scheme Scheme
// Target is either the host, host:port, or unix socket path.
Target string
// Port is the port number, or 0 if not specified.
Port int
// contains filtered or unexported fields
}
URL is a parsed URL.
func ParseURL ¶
ParseURL parses a URL string into a URL struct. URLs can be of the form: - http://localhost:8080 - tcp://localhost:8080 - localhost:8080 - localhost - unix:///var/run/kwil.sock If the URL does not have a scheme, it is assumed to be a tcp address. If it does not have a port, it is set to 0. This is only appropriate for listen addresses.
func ParseURLWithDefaultScheme ¶
ParseURLWithDefaultScheme is like ParseURL, but the default scheme may be specified. If empty, "tcp://" is used.
Click to show internal directories.
Click to hide internal directories.