github.com/altipla-consulting/ravendb-go-client@v0.1.3/start_indexing_operation.go (about) 1 package ravendb 2 3 import ( 4 "net/http" 5 ) 6 7 var _ IVoidMaintenanceOperation = &StartIndexingOperation{} 8 9 type StartIndexingOperation struct { 10 Command *StartIndexingCommand 11 } 12 13 func NewStartIndexingOperation() *StartIndexingOperation { 14 return &StartIndexingOperation{} 15 } 16 17 func (o *StartIndexingOperation) GetCommand(conventions *DocumentConventions) (RavenCommand, error) { 18 o.Command = NewStartIndexingCommand() 19 return o.Command, nil 20 } 21 22 var ( 23 _ RavenCommand = &StartIndexingCommand{} 24 ) 25 26 type StartIndexingCommand struct { 27 RavenCommandBase 28 } 29 30 func NewStartIndexingCommand() *StartIndexingCommand { 31 cmd := &StartIndexingCommand{ 32 RavenCommandBase: NewRavenCommandBase(), 33 } 34 cmd.ResponseType = RavenCommandResponseTypeEmpty 35 return cmd 36 } 37 38 func (c *StartIndexingCommand) createRequest(node *ServerNode) (*http.Request, error) { 39 url := node.URL + "/databases/" + node.Database + "/admin/indexes/start" 40 41 return newHttpPost(url, nil) 42 }