Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (28 sloc) 802 Bytes
package ravendb
import "net/http"
var (
_ RavenCommand = &DeleteDocumentCommand{}
)
type DeleteDocumentCommand struct {
RavenCommandBase
_id string
_changeVector *string
}
func NewDeleteDocumentCommand(id string, changeVector *string) *DeleteDocumentCommand {
cmd := &DeleteDocumentCommand{
RavenCommandBase: NewRavenCommandBase(),
_id: id,
_changeVector: changeVector,
}
cmd.ResponseType = RavenCommandResponseTypeEmpty
return cmd
}
func (c *DeleteDocumentCommand) createRequest(node *ServerNode) (*http.Request, error) {
url := node.URL + "/databases/" + node.Database + "/docs?id=" + urlEncode(c._id)
request, err := newHttpDelete(url, nil)
if err != nil {
return nil, err
}
addChangeVectorIfNotNull(c._changeVector, request)
return request, nil
}
You can’t perform that action at this time.