mirror of
https://github.com/luxfi/lpm.git
synced 2026-10-30 16:20:57 +00:00
- Update node v1.16.15 → v1.19.8 - Update crypto v1.17.0 → v1.17.4 - Update database v1.2.0 → v1.2.1 - Update geth v1.16.34 → v1.16.35 - Update ids v1.1.0 → v1.1.1 - Update Go 1.25 → 1.25.1 - Update copyright year to 2025
31 lines
681 B
Go
31 lines
681 B
Go
// Copyright (C) 2019-2025, Lux Partners Limited. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package util
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/luxfi/lpm/constant"
|
|
)
|
|
|
|
func ParseQualifiedName(name string) (source string, plugin string) {
|
|
parsed := strings.Split(name, constant.QualifiedNameDelimiter)
|
|
|
|
return parsed[0], parsed[1]
|
|
}
|
|
|
|
func ParseAlias(alias string) (organization string, repository string) {
|
|
parsed := strings.Split(alias, constant.AliasDelimiter)
|
|
|
|
return parsed[0], parsed[1]
|
|
}
|
|
|
|
func ValidAlias(alias string) bool {
|
|
if organization, repository := ParseAlias(alias); organization == "" || repository == "" {
|
|
return false
|
|
}
|
|
|
|
return true
|
|
}
|