buildurl

package
v0.18.0-dev Latest Latest
Warning

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

Go to latest
Published: May 27, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(options ...Option) string

Types

type Option

type Option func(*URLBuilder)

Option type for functional options

func WithBasePath

func WithBasePath(basePath string) Option

WithBasePath sets the base path of the URL

func WithListQueryParam

func WithListQueryParam(key string, values []string) Option

WithListQueryParam adds the query parameter multiple times to the URL. Once per element in the values slice.

func WithPathElement

func WithPathElement(element string) Option

WithPathElement adds a path element to the URL

func WithQueryParam

func WithQueryParam(key, value string) Option

WithQueryParam adds a query parameter to the URL

type URLBuilder

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

URLBuilder struct to hold the components of the URL

func NewURLBuilder

func NewURLBuilder(options ...Option) *URLBuilder

NewURLBuilder creates a new URLBuilder with the given options

func (*URLBuilder) Build

func (ub *URLBuilder) Build() string

Build constructs the final URL string

Jump to

Keyboard shortcuts

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