forked from ravendb/ravendb-go-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_identities_operation.go
47 lines (35 loc) · 1007 Bytes
/
get_identities_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
43
44
45
46
47
package ravendb
import (
"net/http"
)
var (
_ IMaintenanceOperation = &GetIdentitiesOperation{}
)
type GetIdentitiesOperation struct {
Command *GetIdentitiesCommand
}
func NewGetIdentitiesOperation() *GetIdentitiesOperation {
return &GetIdentitiesOperation{}
}
func (o *GetIdentitiesOperation) GetCommand(conventions *DocumentConventions) (RavenCommand, error) {
o.Command = NewGetIdentitiesCommand()
return o.Command, nil
}
type GetIdentitiesCommand struct {
RavenCommandBase
Result map[string]int
}
func NewGetIdentitiesCommand() *GetIdentitiesCommand {
cmd := &GetIdentitiesCommand{
RavenCommandBase: NewRavenCommandBase(),
}
cmd.IsReadRequest = true
return cmd
}
func (c *GetIdentitiesCommand) CreateRequest(node *ServerNode) (*http.Request, error) {
url := node.URL + "/databases/" + node.Database + "/debug/identities"
return newHttpGet(url)
}
func (c *GetIdentitiesCommand) SetResponse(response []byte, fromCache bool) error {
return jsonUnmarshal(response, &c.Result)
}