// Put is a shortcut for router.Add("PUT", path, handle)
8299
func (r *Router) Put(path string, handler HandlerFunc) {
	r.Add(PUT, path, handler)
}
1263269
func (store *FileStore) Put(key string, m packets.ControlPacket) {
	store.Lock()
	defer store.Unlock()
	if !store.opened {
		ERROR.Println(STR, "Trying to use file store, but not open")
		return
	}
	full := fullpath(store.directory, key)
	write(store.directory, key, m)
	if !exists(full) {
		ERROR.Println(STR, "file not created:", full)
	}
}
660106
func (r *Route) PutFunc(f http.HandlerFunc) *Route {
	return r.Put(http.HandlerFunc(f))
}
834528
func (b *Backend) Put(ctx context.Context, entry *physical.Entry) (retErr error) {
	defer metrics.MeasureSince(metricPut, time.Now())

	// Pooling
	b.permitPool.Acquire()
	defer b.permitPool.Release()

	// Insert
	w := b.client.Bucket(b.bucket).Object(entry.Key).NewWriter(ctx)
	w.ChunkSize = b.chunkSize
	md5Array := md5.Sum(entry.Value)
	w.MD5 = md5Array[:]
	defer func() {
		closeErr := w.Close()
		if closeErr != nil {
			retErr = multierror.Append(retErr, errwrap.Wrapf("error closing connection: {{err}}", closeErr))
		}
	}()

	if _, err := w.Write(entry.Value); err != nil {
		return errwrap.Wrapf("failed to put data: {{err}}", err)
	}
	return nil
}
1332699
func (rc *RequestConfig) PUT(path string) *RequestConfig {
	rc.Path = path
	rc.Method = "PUT"

	return rc
}
1129078
func PUT(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes {
	return engine().PUT(relativePath, handlers...)
}
633727
func (s *Server) Put(path string, h HandlerFunc, opts ...HandlerOption) {
	s.register(http.MethodPut, path, h, opts...)
}
785909
func (r *Router) Patch(path string, handler HandlerFunc) {
	r.Add(PATCH, path, handler)
}
54708
func (r *Router) Put(path string, fn http.HandlerFunc) *Router {
	return r.Method(http.MethodPut, path, fn)
}
1264922
func (g *Group) PUT(path string, h HandlerFunc, m ...MiddlewareFunc) *Route {
	return g.Add(http.MethodPut, path, h, m...)
}
1107740
func (bridge *Bridge) Put(path string, params interface{}) ([]byte, io.Reader, error) {
	uri := fmt.Sprintf("http://" + bridge.IPAddress + path)
	client := &http.Client{Timeout: time.Second * 5}

	data, err := json.Marshal(params)
	if err != nil {
		err = errors.New("unable to marshal PUT request interface")
		return []byte{}, nil, err
	}
	//fmt.Println("\n\nPARAMS: ", params)

	request, _ := http.NewRequest("PUT", uri, bytes.NewReader(data))
	resp, err := client.Do(request)
	if err != nil {
		err = errors.New("unable to access bridge")
		return []byte{}, nil, err
	}
	return HandleResponse(resp)
}
1064526
func (s *Server) Put(route string, handler interface{}) {
	s.addRoute(route, "PUT", handler)
}
245749
func (r *Router) Add(method string, path string, handler HandlerFunc) {
	_logger.debug("===Add")
	if len(path) == 0 {
		panic("router: path couldn't be empty")
	}
	if path[0] != '/' {
		panic("router: path was invalid")
	}
	if len(path) > 1 {
		path = path[1:]
	}
	_logger.debug("path:" + path)

	currentNode := r.tree.rootNode
	if path == "/" {
		currentNode.addHandler(method, handler)
		return
	}

	pathArray := strings.Split(path, "/")
	count := len(pathArray)
	pathParams := []string{}

	for index, element := range pathArray {
		if len(element) == 0 {
			continue
		}

		var childNode *node
		firstSymbol := element[0]
		if firstSymbol == ':' {
			// this is parameter node
			pName := element[1:]
			_logger.debug("parameter_node_pname:" + pName)
			childNode = currentNode.findChildByKind(pkind)
			if childNode == nil {
				childNode = newNode(pName, pkind)
				currentNode.addChild(childNode)
			}

			isFound := false
			for _, p := range childNode.pNames {
				if p == pName {
					isFound = true
				}
			}

			if isFound == false {
				childNode.pNames = append(childNode.pNames, pName)
				_logger.debug("add_parameter_name:" + pName)
			}

			pathParams = append(pathParams, pName)

		} else if firstSymbol == '*' {
			// this is match any node.  We should allow one match any node only.
			pName := element[1:]
			_logger.debug("match_node_pname:" + pName)
			childNode = currentNode.findChildByKind(akind)
			if childNode == nil {
				childNode = newNode(pName, akind)
				currentNode.addChild(childNode)
				childNode.pNames = append(childNode.pNames, pName)
			}

			pathParams = append(pathParams, pName)

		} else {
			// this is static node
			childNode = currentNode.findChildByName(element)
			if childNode == nil {
				childNode = newNode(element, skind)
				currentNode.addChild(childNode)
			}
		}

		// last node in the path
		if count == index+1 {
			childNode.params = pathParams
			childNode.addHandler(method, handler)
		}

		currentNode = childNode
	}

}
758130
func (c *Client) Put() {
	select {
	case b := <-c.sent:
		c.p.ch <- b
	default:
	}
}
387027
func Put(url string, v ...interface{}) (*Resp, error) {
	return std.Put(url, v...)
}
1153943
func (h *DBHandle) Put(key []byte, value []byte, sync bool) error {
	return h.db.Put(constructLevelKey(h.dbName, key), value, sync)
}
714134
func (c *Client) Put() *Request {
	req := c.Request()
	req.Method("PUT")
	return req
}