(name string, namespace string, runtimeType string, opts ...RuntimeInfoOption)
| 184 | } |
| 185 | |
| 186 | func BuildRuntimeInfo(name string, |
| 187 | namespace string, |
| 188 | runtimeType string, |
| 189 | opts ...RuntimeInfoOption) (runtime RuntimeInfoInterface, err error) { |
| 190 | |
| 191 | runtime = &RuntimeInfo{ |
| 192 | name: name, |
| 193 | namespace: namespace, |
| 194 | runtimeType: runtimeType, |
| 195 | } |
| 196 | for _, fn := range opts { |
| 197 | if err := fn(runtime.(*RuntimeInfo)); err != nil { |
| 198 | return nil, errors.Wrapf(err, "fail to build runtime info \"%s/%s\"", namespace, name) |
| 199 | } |
| 200 | } |
| 201 | return |
| 202 | } |
| 203 | |
| 204 | type RuntimeInfoOption func(info *RuntimeInfo) error |
| 205 |
no outgoing calls