tags

package module
v0.0.0-...-92a8a80 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

README

go-tags

Work in progress.

Documentation

Overview

package tag provides interfaces and methods for working with tags.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanStringTag

func CleanStringTag(raw string) (string, error)

func IsNotMachineTagError

func IsNotMachineTagError(err error) bool

Return a boolean value indicating whether or not err is of type NotMachineTagError

Types

type NotMachineTagError

type NotMachineTagError struct{}

type NotMachineTagError defines an implementation of the error interface signaling that a tag is not a valid machine tag.

func (NotMachineTagError) Error

func (e NotMachineTagError) Error() string

The string representation of a NotMachineTagError error.

type StringTag

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

type StringTag implements the Tag interface for string-based tags.

func (*StringTag) Clean

func (t *StringTag) Clean() string

func (*StringTag) IsMachineTag

func (t *StringTag) IsMachineTag() bool

func (*StringTag) Namespace

func (t *StringTag) Namespace() (string, error)

func (*StringTag) Predicate

func (t *StringTag) Predicate() (string, error)

func (*StringTag) Raw

func (t *StringTag) Raw() string

func (*StringTag) Value

func (t *StringTag) Value() (string, error)

type Tag

type Tag interface {
	// The raw user-defined string tag value.
	Raw() string
	// The URI-safe value of the raw tag value.
	Clean() string
	// A boolean flag indicating whether or not the tag can be parsed as a machine tag.
	IsMachineTag() bool
	// The namespace value of a valid machine tag triple.
	Namespace() (string, error)
	// The predicate value of a valid machine tag triple.
	Predicate() (string, error)
	// The value of a valid machine tag triple.
	Value() (string, error)
}

type Tag defines a common interface for working with tag values.

func NewStringTag

func NewStringTag(raw string) (Tag, error)

Jump to

Keyboard shortcuts

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