uri

package
v0.0.0-...-c9505bf Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SchemeMagnet  = "magnet"
	SchemeED2k    = "ed2k"
	SchemeFTP     = "ftp"
	SchemeUnknown = ""
)

Schemes for different protocols.

Variables

This section is empty.

Functions

func GetScheme

func GetScheme(s string) string

GetScheme returns the scheme of the given link if it has one, otherwise empty string will be returned.

func IsED2k

func IsED2k(s string) bool

IsMagnet returns true if given string is an ED2k link.

func IsFTP

func IsFTP(s string) bool

IsMagnet returns true if given string is a FTP link.

func IsMagnet

func IsMagnet(s string) bool

IsMagnet returns true if given string is a magnet link.

Types

type URI

type URI struct {
	Scheme string
	// contains filtered or unexported fields
}

URI contains higher level information from a url.URL.

func NewURI

func NewURI(s string) *URI

NewURI creates a URI from given string.

func (*URI) DisplayName

func (u *URI) DisplayName() string

DisplayName returns a human-friendly name of the object that the URI is pointing to. NOTE: If there's none, the full URI will be returned.

func (*URI) IsValid

func (u *URI) IsValid() bool

IsValid returns true if the URI has a known scheme.

Jump to

Keyboard shortcuts

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