queues

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package queues contains helper functions for manipulation of queue names.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EscapeComponent

func EscapeComponent(c string) string

EscapeComponent adds backslash in front of backslash and forward slash.

func Namespace

func Namespace(qname string) (string, bool)

Namespace returns the namespace component from a queue name, if it exists.

func PathComponents

func PathComponents(qname string) []string

PathComponents returns a list of the path components in this queue name. It basically assumes that the name is structured like a POSIX file path, including escaping of / where needed. It includes the beginning '/' as part of the component, if it has one. A path ending in / will have a final component of just that character.

func PathParams

func PathParams(qname string) map[string][]string

PathParams returns a map from strings to slices of values. It looks through the queue name, assuing that it is basically structured like a path, with some `/key=value/` components, and extracts those key/value pairs into what is essentially a multimap.

Note that `/key=` is the criterion for search. If the key=value does not start with a slash, it is not picked up. This allows for escaping of the / character, so `\/` cannot start one of these path components.

func TryAddNamespace

func TryAddNamespace(qname, ns string) string

TryAddNamespace attempts to add the given namespace to the queue name. If there is already a namespace, it gives up. Otherwise it prepends with /ns=namespace/.

Types

This section is empty.

Jump to

Keyboard shortcuts

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