MCPcopy
hub / github.com/helmfile/helmfile / ParseNormal

Function ParseNormal

pkg/remote/remote.go:165–189  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

163}
164
165func ParseNormal(path string) (*Source, error) {
166 _, err := ParseNormalProtocol(path)
167 if err != nil {
168 return nil, err
169 }
170
171 u, err := url.Parse(path)
172 if err != nil {
173 return nil, err
174 }
175 dir := filepath.Dir(u.Path)
176 if len(dir) > 0 {
177 dir = dir[1:]
178 }
179
180 return &Source{
181 Getter: "normal",
182 User: u.User.String(),
183 Scheme: u.Scheme,
184 Host: u.Host,
185 Dir: dir,
186 File: filepath.Base(u.Path),
187 RawQuery: u.RawQuery,
188 }, nil
189}
190
191func ParseNormalProtocol(path string) (string, error) {
192 parts := strings.Split(path, "://")

Callers 1

ParseFunction · 0.85

Calls 3

ParseNormalProtocolFunction · 0.85
ParseMethod · 0.80
StringMethod · 0.80

Tested by

no test coverage detected