MCPcopy Index your code
hub / github.com/GoEdgeLab/EdgeNode / NewMethodInstance

Function NewMethodInstance

internal/encrypt/method_utils.go:15–26  ·  view source on GitHub ↗
(method string, key string, iv string)

Source from the content-addressed store, hash-verified

13}
14
15func NewMethodInstance(method string, key string, iv string) (MethodInterface, error) {
16 valueType, ok := methods[method]
17 if !ok {
18 return nil, errors.New("method '" + method + "' not found")
19 }
20 instance, ok := reflect.New(valueType).Interface().(MethodInterface)
21 if !ok {
22 return nil, errors.New("method '" + method + "' must implement MethodInterface")
23 }
24 err := instance.Init([]byte(key), []byte(iv))
25 return instance, err
26}
27
28func RecoverMethodPanic(err interface{}) error {
29 if err != nil {

Callers 13

ContextMethod · 0.92
ClusterContextMethod · 0.92
TestFindMethodInstanceFunction · 0.85
MagicKeyEncodeFunction · 0.85
MagicKeyDecodeFunction · 0.85
TestRawMethod_EncryptFunction · 0.85

Calls 1

InitMethod · 0.65