url

package
v0.31.10 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

package url contains url utilities beyond what is available in the net/url package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFloat64

func GetFloat64(values url.Values, name string) (value float64, err error)

GetFloat64 extracts the named float64 out of values.

func GetInt

func GetInt(values url.Values, name string) (value int, err error)

GetInt extracts the named int out of values.

func GetString

func GetString(values url.Values, name string) (value string, err error)

GetString extracts the named string out of values.

func GetStrings

func GetStrings(values url.Values, name string) (value []string, err error)

GetStrings returns the string array associated with the name

Types

type Builder

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

Builder uses a builder pattern to create a URL.

func NewBuilder

func NewBuilder(path string) *Builder

NewBuilder starts a URL builder from a basic path.

func NewBuilderFromUrl added in v0.1.1

func NewBuilderFromUrl(u *url2.URL) *Builder

NewBuilderFromUrl creates a new builder from a URL.

func (*Builder) ClearFragment added in v0.1.1

func (u *Builder) ClearFragment() *Builder

ClearFragment removes the fragment from the URL.

func (*Builder) RemoveValue added in v0.1.1

func (u *Builder) RemoveValue(k string) *Builder

RemoveValue removes the value from the URL

func (*Builder) SetFragment added in v0.1.1

func (u *Builder) SetFragment(f string) *Builder

SetFragment sets the fragment portion of the URL

func (*Builder) SetValue added in v0.1.1

func (u *Builder) SetValue(k string, v any) *Builder

SetValue sets the GET value in the URL

func (*Builder) SetValues added in v0.27.6

func (u *Builder) SetValues(m map[string]any) *Builder

SetValues sets the GET values in the URL from a map

func (*Builder) String

func (u *Builder) String() string

String returns the encoded URL.

Jump to

Keyboard shortcuts

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