MCPcopy Create free account
hub / github.com/celer-pkg/celer / Validate

Method Validate

configs/rootfs.go:29–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27}
28
29func (r *RootFS) Validate() error {
30 // Validate rootfs download url.
31 if r.Url == "" {
32 return fmt.Errorf("rootfs.url is empty, it's required for downloading and caching")
33 }
34
35 if r.SHA256 == "" {
36 return fmt.Errorf("rootfs.sha256 is empty, it's required for verification and caching")
37 }
38
39 // Validate rootfs path and convert to absolute path.
40 if r.Path == "" {
41 return fmt.Errorf("rootfs.path is empty, it's required for specifying the root filesystem location")
42 }
43
44 r.abspath = filepath.Join(r.ctx.Downloads(), "tools", r.Path)
45
46 return nil
47}
48
49func (r *RootFS) CheckAndRepair() error {
50 // Default folder name is the first folder name of archive name,

Callers

nothing calls this directly

Calls 1

DownloadsMethod · 0.65

Tested by

no test coverage detected