name

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package name provides everything needed to create and validate a name.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Name

type Name string

Name of a topic, or queue.

func MustNew added in v1.0.14

func MustNew(name string) Name

MustNew creates a new name. It should be in the format of the following example: "v1.meta.created" or "v1.meta.created.queue". It panics if the name is invalid.

func New added in v1.0.14

func New(name string) (Name, error)

New creates a new name. It should be in the format of the following example: "v1.meta.created" or "v1.meta.created.queue".

func (Name) Parts

func (n Name) Parts() []string

Parts breaks a Name into its parts.

func (Name) String

func (n Name) String() string

Implement the Stringer interface.

func (Name) ToQueue

func (n Name) ToQueue() Queue

ToQueue converts a Name to a Queue, adding the .queue suffix only if it's not already there.

func (Name) ToTopic

func (n Name) ToTopic() Topic

ToTopic converts a Name to a Topic, removing the .queue suffix only if it's there.

func (Name) Validate

func (n Name) Validate() error

Validate the name.

type Queue

type Queue Name

Queue is the name of a queue. Should be in the form of the following example: "v1.meta.created.queue".

type Topic

type Topic Name

Topic is the name of a topic. Should be in the form of the following example: "v1.meta.created".

Jump to

Keyboard shortcuts

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