uri

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	LakeFSSchema          = "lakefs"
	LakeFSSchemaSeparator = "://"
	PathSeparator         = "/"
)

Variables

View Source
var (
	ErrMalformedURI     = errors.New("malformed lakefs URI")
	ErrInvalidRepoURI   = errors.New("not a valid repo URI")
	ErrInvalidRefURI    = errors.New("not a valid ref URI")
	ErrInvalidBranchURI = errors.New("not a valid branch URI")
	ErrInvalidPathURI   = errors.New("not a valid path URI")
)

Functions

func Equals

func Equals(a, b *URI) bool

func IsValid

func IsValid(str string) bool

Types

type URI

type URI struct {
	// Repository is the name of the repository being addressed
	Repository string
	// Ref represents the reference in the repository (commit, tag, branch, etc.)
	Ref string
	// Path is a path to an object (or prefix of such) in lakeFS. It *could* be null since there's a difference between
	// 	an empty path ("lakefs://repo/branch/", and no path at all e.g. "lakefs://repo/branch").
	// 	Since path is the only URI part that is allowed to be empty, it is represented as a pointer.
	Path *string
}

func Must

func Must(u *URI, e error) *URI

func Parse

func Parse(s string) (*URI, error)

func ParseWithBaseURI added in v0.40.0

func ParseWithBaseURI(s string, baseURI string) (*URI, error)

ParseWithBaseURI parse URI uses base URI as prefix when set and input doesn't start with lakeFS protocol

func (*URI) GetPath added in v0.40.0

func (u *URI) GetPath() string

func (*URI) String

func (u *URI) String() string

func (*URI) ValidateBranch added in v1.1.0

func (u *URI) ValidateBranch() error

func (*URI) ValidateFullyQualified added in v1.1.0

func (u *URI) ValidateFullyQualified() error

func (*URI) ValidateRef added in v1.1.0

func (u *URI) ValidateRef() error

func (*URI) ValidateRepository added in v1.1.0

func (u *URI) ValidateRepository() error

func (*URI) WithRef added in v0.106.0

func (u *URI) WithRef(ref string) *URI

WithRef returns a new URI from u replacing the Reference part with the given ref

Jump to

Keyboard shortcuts

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