diff options
| author | 泽淼 周 <zhouzemiao@ihuman.com> | 2025-09-26 19:54:44 +0800 |
|---|---|---|
| committer | Chris Lu <chrislusf@users.noreply.github.com> | 2025-12-06 18:53:22 -0800 |
| commit | 2828d5a05c36aa8719778142eb4472007906f14c (patch) | |
| tree | 7a60daa0bc9cf86204ddeddc94bc7dc748483cb5 /pkg/mountmanager/endpoint.go | |
| parent | fd2b35494095ccf7b06fb210305406f83ed17998 (diff) | |
| download | seaweedfs-csi-driver-2828d5a05c36aa8719778142eb4472007906f14c.tar.xz seaweedfs-csi-driver-2828d5a05c36aa8719778142eb4472007906f14c.zip | |
feat: Separated weed mount lifecycle into a dedicated service and rewired the CSI components to call it.
Diffstat (limited to 'pkg/mountmanager/endpoint.go')
| -rw-r--r-- | pkg/mountmanager/endpoint.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/pkg/mountmanager/endpoint.go b/pkg/mountmanager/endpoint.go new file mode 100644 index 0000000..1424536 --- /dev/null +++ b/pkg/mountmanager/endpoint.go @@ -0,0 +1,15 @@ +package mountmanager + +import ( + "fmt" + "strings" +) + +// ParseEndpoint splits an endpoint string like "unix:///path" into scheme and address. +func ParseEndpoint(endpoint string) (scheme, address string, err error) { + parts := strings.SplitN(endpoint, "://", 2) + if len(parts) != 2 || parts[1] == "" { + return "", "", fmt.Errorf("invalid endpoint: %s", endpoint) + } + return strings.ToLower(parts[0]), parts[1], nil +} |
