moreurls

package
v0.32.3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build added in v0.30.0

func Build(urll string, params Params) string

Constructs a URL with the given parameters.

func FQDN added in v0.31.0

func FQDN(urll string) string

Returns the fully qualified domain name of the URL.

Types

type Params added in v0.30.0

type Params struct {
	// contains filtered or unexported fields
}

Params struct, containing a slice of KVPairs.

func NewParams added in v0.30.0

func NewParams(elem ...string) Params

Constructs a new slice of KVPairs with provided keys and values. Input should be in pairs: "key1, value1, key2, value2, key3, value3, ..." Number of elements must be even, otherwise this function panics.

func (Params) Copy added in v0.30.0

func (p Params) Copy() Params

Returns a copy (including the slice of KVPairs).

func (Params) Get added in v0.30.0

func (p Params) Get(k string) (string, bool)

Returns the value of the first occurence with the provided key and returns true. If not found, returns empty string and false.

func (Params) QueryEscape added in v0.30.0

func (p Params) QueryEscape() string

Returns URL encoded params in format "foo=bar&baz=woo".

func (*Params) Set added in v0.30.0

func (p *Params) Set(k, v string) bool

Sets the value to the first occurence of the provided key and returns true. If not found, appends new KVPair and returns false.

func (Params) String added in v0.30.0

func (p Params) String() string

Returns raw params in format "foo=bar&baz=woo".

Jump to

Keyboard shortcuts

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