parser

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MIT Imports: 3 Imported by: 6

Documentation

Index

Constants

View Source
const (
	URL_SCHEME_HTTPS     = "https"
	URL_SCHEME_HTTP      = "http"
	URL_SCHEME_MYSQL     = "mysql"
	URL_SCHEME_POSTGRES  = "postgres"
	URL_SCHEME_REDIS     = "redis"
	URL_SCHEME_ETCD      = "etcd"
	URL_SCHEME_KAFKA     = "kafka"
	URL_SCHEME_MSSQL     = "mssql"
	URL_SCHEME_ZOOKEEPER = "zookeeper"
	URL_SCHEME_SEP       = "://"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type UrlInfo

type UrlInfo struct {
	Scheme     string            // http...
	Host       string            // host name and port eg. '127.0.0.1:3306'
	User       string            // user
	Password   string            // password
	Path       string            // path
	Fragment   string            // fragment
	Opaque     string            // opaque
	ForceQuery bool              // force query
	Queries    map[string]string // queries
}

func ParseUrl

func ParseUrl(strUrl string) (ui *UrlInfo)

URL have some special characters in password(支持URL中密码包含特殊字符)

func (*UrlInfo) GetForceQuery

func (u *UrlInfo) GetForceQuery() bool

func (*UrlInfo) GetFragment

func (u *UrlInfo) GetFragment() string

func (*UrlInfo) GetHost

func (u *UrlInfo) GetHost() string

func (*UrlInfo) GetIPAndPort

func (u *UrlInfo) GetIPAndPort() (ip string, port int)

func (*UrlInfo) GetOpaque

func (u *UrlInfo) GetOpaque() string

func (*UrlInfo) GetPassword

func (u *UrlInfo) GetPassword() string

func (*UrlInfo) GetPath

func (u *UrlInfo) GetPath() string

func (*UrlInfo) GetQueries

func (u *UrlInfo) GetQueries() map[string]string

func (*UrlInfo) GetScheme

func (u *UrlInfo) GetScheme() string

func (*UrlInfo) GetUser

func (u *UrlInfo) GetUser() string

Jump to

Keyboard shortcuts

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