// NewCallType returns returns an 'enum' value of type callType given its
// string representation
167858
func NewCallType(s string) (callType, error) {
	var e callType
	err := e.FromString(s)
	if err != nil {
		return 0, err
	}
	return e, nil
}
522335
func NewParameterWithType(name string, data string) Parameter {
	return Parameter{name, data, Expression(data)}
}
975863
func newCaller(kv kvdb.Kvdb) (*configManager, error) {
	manager := new(configManager)

	manager.cbCluster = make(map[string]CallbackClusterConfigFunc)
	manager.cbNode = make(map[string]CallbackNodeConfigFunc)

	// kvdb pointer
	manager.kv = kv

	return manager, nil
}
79213
func NewBalType(s string) (balType, error) {
	var e balType
	err := e.FromString(s)
	if err != nil {
		return 0, err
	}
	return e, nil
}
1001628
func (t *typeChecker) AcceptCall(v tree.Call) {
	t.result = fmt.Errorf("found unresolved call: %s", v.Name)
}
727920
func UnmarshalToCallback(in io.Reader, f interface{}) error {
	valueFunc := reflect.ValueOf(f)
	t := reflect.TypeOf(f)
	if t.NumIn() != 1 {
		return fmt.Errorf("the given function must have exactly one parameter")
	}
	cerr := make(chan error)
	c := reflect.MakeChan(reflect.ChanOf(reflect.BothDir, t.In(0)), 0)
	go func() {
		cerr <- UnmarshalToChan(in, c.Interface())
	}()
	for {
		select {
		case err := <-cerr:
			return err
		default:
		}
		v, notClosed := c.Recv()
		if !notClosed || v.Interface() == nil {
			break
		}
		valueFunc.Call([]reflect.Value{v})
	}
	return nil
}
1279409
func NewCreateFolderType(Description string) *CreateFolderType {
	s := new(CreateFolderType)
	s.Description = Description
	return s
}
287599
func NewCallFunctionOnArgs(functionDeclaration string) *CallFunctionOnArgs {
	args := new(CallFunctionOnArgs)
	args.FunctionDeclaration = functionDeclaration
	return args
}
258128
func CallFunc(receiver interface{}, methodName string, args ...interface{}) interface{} {
	var ptr reflect.Value
	var value reflect.Value

	value, ok := receiver.(reflect.Value)

	if !ok {
		value = reflect.ValueOf(receiver)
	}

	funcArgs := WrapArguments(args...)

	ptr, value = getReflectPtrAndValue(value, receiver)

	method := value.MethodByName(methodName)

	if method.IsValid() {
		return UnwrapReflectValues(method.Call(funcArgs))
	}

	method = ptr.MethodByName(methodName)

	if method.IsValid() {
		return UnwrapReflectValues(method.Call(funcArgs))
	}

	panic(fmt.Sprintf("%T type objects don't have %s method.", value.Interface(), methodName))
}
1131469
func NewFileRevertType(Description string) *FileRevertType {
	s := new(FileRevertType)
	s.Description = Description
	return s
}
285499
func NewUnknownElementType(method string, el interface{}) UnknownElementType {
	return UnknownElementType{method: method, element: el}
}
1108252
func NewCallSiteConsoleLogger(name string, depth int, l LevelInfo) (Sender, error) {
	return setup(MakeCallSiteConsoleLogger(depth), name, l)
}
352221
func (self *_object) isCall() bool {
	switch fn := self.value.(type) {
	case _nativeFunctionObject:
		return fn.call != nil
	case _bindFunctionObject:
		return true
	case _nodeFunctionObject:
		return true
	}
	return false
}
624648
func NewMatcher(kind types.Type, fn Matcher) TypeMatcher {
	matcher := func(buf []byte) types.Type {
		if fn(buf) {
			return kind
		}
		return types.Unknown
	}

	Matchers[kind] = matcher
	// prepend here so any user defined matchers get added first
	MatcherKeys = append([]types.Type{kind}, MatcherKeys...)
	return matcher
}
1047776
func NewDialFunc(optFuncs ...dialerOpt) func(string, string) (net.Conn, error) {
	dialContextFunc := NewDialContextFunc(optFuncs...)
	return func(network string, addr string) (net.Conn, error) {
		return dialContextFunc(context.TODO(), network, addr)
	}
}
1334244
func (c *Call) CallArg(key string) (*Call, bool, error) {
	val, ok := c.Args[key]
	if !ok {
		return nil, false, nil
	}
	switch tval := val.(type) {
	case *Call:
		return tval, true, nil
	default:
		return nil, true, fmt.Errorf("could not convert %v of type %T to Call in Call.CallArg", tval, tval)
	}
}
883948
func NewCallWrapper() client.CallWrapper {
	return func(cf client.CallFunc) client.CallFunc {
		return func(ctx context.Context, node *registry.Node, req client.Request, rsp interface{}, opts client.CallOptions) error {
			t := newRequestTracker(req, ClientProfile)
			ctx = t.StartSpanFromContext(ctx)

			defer func() {
				t.finishWithError(nil, noDebugStack)
			}()

			return cf(ctx, node, req, rsp, opts)
		}
	}
}