uri

package
v0.33.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolSeparator = "://"
	LakeFSProtocol    = "lakefs"

	RefSeparator  = '@'
	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")
	ErrInvalidPathURI = errors.New("not a valid path uri")
)

Functions

func Equals

func Equals(a, b *URI) bool

func IsValid

func IsValid(str string) bool

func ValidatePathURI

func ValidatePathURI(str string) error

func ValidateRefURI

func ValidateRefURI(str string) error

func ValidateRepoURI

func ValidateRepoURI(str string) error

Types

type URI

type URI struct {
	// Protocol must always match "lakefs" to be considered valid
	Protocol string
	// 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(str string) (*URI, error)

func (*URI) IsFullyQualified

func (u *URI) IsFullyQualified() bool

func (*URI) IsRef

func (u *URI) IsRef() bool

func (*URI) IsRepository

func (u *URI) IsRepository() bool

func (*URI) String

func (u *URI) String() string

Jump to

Keyboard shortcuts

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