added Name func to ID

This commit is contained in:
Djeeberjr 2021-11-23 01:53:04 +01:00
parent 2353a0bf53
commit 80302b62f4

View File

@ -80,6 +80,11 @@ func (i ID) Parent() *ID {
return parent
}
// Name returns filename or directory name
func (i ID) Name() string {
return filepath.Base(i.Key)
}
// ParseID parses a string to an ID. Null if invalid
func ParseID(id string) *ID {
match := idRegex.FindStringSubmatch(id)