Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FullNameEqual ¶
FullNameEqual returns true if the FullNames are equal.
func FullNameStringToUniqueValue ¶
func FullNameStringToUniqueValue[T HasFullName, S ~[]T](values S) (map[string]T, error)
FullNameStringToUniqueValue maps the values that implement HasFullName to a map from FullName string to the unique value that has this FullName.
If any value has a nil FullName, this value is not added to the map. Therefore, for types that potentially have a nil FullName, you cannot reply on this function returning a map of the same length as the input values.
Returns error if there are values with duplicate FullNames.
Types ¶
type FullName ¶
type FullName interface {
// String returns "registry/owner/name".
fmt.Stringer
// Registry returns the hostname of the BSR instance that this entity is contained within.
Registry() string
// Owner returns the name of the user or organization that owns this entity.
Owner() string
// Name returns the name of the entity.
Name() string
// contains filtered or unexported methods
}
FullName represents the full name of the entity, including its registry, owner, and name.
func NewFullName ¶
NewFullName returns a new FullName for the given components.
func ParseFullName ¶
ParseFullName parses a FullName from a string in the form "registry/owner/name".
Returns an error of type *ParseError if the string could not be parsed.
type HasFullName ¶
type HasFullName interface {
// FullName returns the ullName.
//
// May be empty.
FullName() FullName
}
HasFullName is any type that has a FullName() function.
type ParseError ¶
type ParseError struct {
// contains filtered or unexported fields
}
ParseError is an error that occurred during parsing.
This is returned by all Parse.* functions in this package.
func NewParseError ¶
func NewParseError(typeString string, input string, err error) *ParseError
NewParseError returns a new ParseError.
typeString is the user-consumable string representing of the type that was attempted to be parsed. input is the input string that was attempted to be parsed. err is the underlying error.
func (*ParseError) Error ¶
func (p *ParseError) Error() string
Error implements the error interface.
func (*ParseError) Input ¶
func (p *ParseError) Input() string
Input returns the input string that was attempted to be parsed.
func (*ParseError) Unwrap ¶
func (p *ParseError) Unwrap() error
Unwrap returns the underlying error.
type Ref ¶
type Ref interface {
// String returns "registry/owner/name[:ref]".
fmt.Stringer
// FullName returns the full name of the .
//
// Always present.
FullName() FullName
// Ref returns the reference within the .
//
// May be a label or dashless commitID.
//
// May be empty, in which case this references the commit of the default label of the .
Ref() string
// contains filtered or unexported methods
}
Ref is an unresolved reference to an entity.