forked from ravendb/ravendb-go-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart_indexing_operation.go
42 lines (32 loc) · 935 Bytes
/
start_indexing_operation.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package ravendb
import (
"net/http"
)
var _ IVoidMaintenanceOperation = &StartIndexingOperation{}
type StartIndexingOperation struct {
Command *StartIndexingCommand
}
func NewStartIndexingOperation() *StartIndexingOperation {
return &StartIndexingOperation{}
}
func (o *StartIndexingOperation) GetCommand(conventions *DocumentConventions) (RavenCommand, error) {
o.Command = NewStartIndexingCommand()
return o.Command, nil
}
var (
_ RavenCommand = &StartIndexingCommand{}
)
type StartIndexingCommand struct {
RavenCommandBase
}
func NewStartIndexingCommand() *StartIndexingCommand {
cmd := &StartIndexingCommand{
RavenCommandBase: NewRavenCommandBase(),
}
cmd.ResponseType = RavenCommandResponseTypeEmpty
return cmd
}
func (c *StartIndexingCommand) CreateRequest(node *ServerNode) (*http.Request, error) {
url := node.URL + "/databases/" + node.Database + "/admin/indexes/start"
return NewHttpPost(url, nil)
}