paths

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatResourcePath

func FormatResourcePath(project, target, environment string) string

FormatResourcePath formats components into a path string Empty components are ignored

func ValidateResourcePath

func ValidateResourcePath(path string) error

ValidateResourcePath checks if a path string is valid

Types

type ResourcePath

type ResourcePath struct {
	Project     string
	Target      string
	Environment string
}

ResourcePath represents a parsed resource path with its components

func ParseResourcePath

func ParseResourcePath(path string) (*ResourcePath, error)

ParseResourcePath parses a path string like "project/target/environment" into its components Returns an error if the path format is invalid

func (*ResourcePath) Contains

func (rp *ResourcePath) Contains(other *ResourcePath) bool

Contains checks if this path contains the other path e.g., "project/target" contains "project"

func (*ResourcePath) Equals

func (rp *ResourcePath) Equals(other *ResourcePath) bool

Equals compares two resource paths for equality

func (*ResourcePath) IsComplete

func (rp *ResourcePath) IsComplete() bool

IsComplete returns true if all components are present (project/target/environment)

func (*ResourcePath) Level

func (rp *ResourcePath) Level() int

Level returns the depth level of the path 0 = empty, 1 = project only, 2 = project/target, 3 = project/target/environment

func (*ResourcePath) MatchesPattern

func (rp *ResourcePath) MatchesPattern(pattern string) bool

MatchesPattern checks if the path matches a pattern using case-insensitive substring matching

func (*ResourcePath) Parent

func (rp *ResourcePath) Parent() *ResourcePath

Parent returns the parent path (one level up) Returns nil if already at root level

func (*ResourcePath) String

func (rp *ResourcePath) String() string

String returns the formatted path string

Jump to

Keyboard shortcuts

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