MCPcopy Index your code
hub / github.com/FunctionStream/function-stream / Validate

Method Validate

common/model/function.go:48–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46}
47
48func (f *Function) Validate() error {
49 if f.Name == "" {
50 return errors.New("function name shouldn't be empty")
51 }
52 if strings.Contains(f.Name, "/") {
53 return errors.New("name should not contain '/'")
54 }
55 if strings.Contains(f.Namespace, "/") {
56 return errors.New("namespace should not contain '/'")
57 }
58 if len(f.Sources) == 0 {
59 return errors.New("sources should be configured")
60 }
61 if f.Replicas <= 0 {
62 return errors.New("replicas should be greater than 0")
63 }
64 return nil
65}

Callers 2

loadFileMethod · 0.95
StartFunctionMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected