conftags

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: MIT, BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

package conftags implements Go struct tag like syntax parser. Used exclusively in Search Replica. You probably don't need it. Syntaxt is slightly different from standard Go struct tag syntax. Contains code from golang standard library (reflect package)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tag

type Tag struct {
	Name   string
	Values []string
}

A Tag is the tag string in a config.

By convention, tag strings are a concatenation of optionally space-separated key:"value" pairs. Each key is a non-empty string consisting of non-control characters other than space (U+0020 ' '), quote (U+0022 '"'), and colon (U+003A ':'). Each value is quoted using U+0022 '"' characters and Go string literal syntax.

type Tags

type Tags []*Tag

Tags can have multiple tags with same name.

func Parse

func Parse(src string) (tags Tags, err error)

func (Tags) Filter

func (tags Tags) Filter(name string) (result Tags)

func (Tags) Get

func (tags Tags) Get(name string) *Tag

returns tag if found, otherwise returns nil

func (*Tags) Parse

func (tags *Tags) Parse(src string) error

Jump to

Keyboard shortcuts

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