Documentation ¶
Overview ¶
Package resourcename implements simple functions to manipulate UTF-8 encoded AIP resource names.
Index ¶
Constants ¶
const RevisionSeparator = '@'
RevisionSeparator is the separator character used to separate resource IDs from revision IDs.
Variables ¶
This section is empty.
Functions ¶
func ContainsWildcard ¶ added in v0.32.0
ContainsWildcard reports whether the specified resource name contains any wildcard segments.
func HasParent ¶ added in v0.28.0
HasParent tests whether name has the specified parent. Wildcard segments (-) are considered.
func Match ¶ added in v0.31.0
Match reports whether the specified resource name matches the specified resource name pattern.
Types ¶
type Literal ¶ added in v0.28.0
type Literal string
Literal is the literal part of a resource name segment.
EBNF
Literal = RESOURCE_ID | RevisionLiteral ; RevisionLiteral = RESOURCE_ID "@" REVISION_ID ;
func (Literal) HasRevision ¶ added in v0.28.0
HasRevision returns true if the literal has a valid revision.
func (Literal) ResourceID ¶ added in v0.28.0
ResourceID returns the literal's resource ID.
func (Literal) RevisionID ¶ added in v0.28.0
RevisionID returns the literal's revision ID.
type Scanner ¶ added in v0.28.0
type Scanner struct {
// contains filtered or unexported fields
}
Scanner scans a resource name.
func (*Scanner) Full ¶ added in v0.28.0
Full returns true if the scanner has detected a full resource name.
func (*Scanner) ServiceName ¶ added in v0.28.0
ServiceName returns the service name, when the scanner has detected a full resource name.
type Segment ¶
type Segment string
Segment is a segment of a resource name or a resource name pattern.
EBNF
Segment = Literal | Variable ; Variable = "{" Literal "}" ;
func (Segment) IsVariable ¶ added in v0.28.0
IsVariable reports whether the segment is a variable segment.
func (Segment) IsWildcard ¶ added in v0.28.0
IsWildcard reports whether the segment is a wildcard.