Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
50 lines (37 sloc) 994 Bytes
package ravendb
import (
"net/http"
"strconv"
)
var (
_ RavenCommand = &GetRevisionsBinEntryCommand{}
)
type GetRevisionsBinEntryCommand struct {
RavenCommandBase
etag int64
pageSize int
Result *JSONArrayResult
}
func NewGetRevisionsBinEntryCommand(etag int64, pageSize int) *GetRevisionsBinEntryCommand {
cmd := &GetRevisionsBinEntryCommand{
RavenCommandBase: NewRavenCommandBase(),
etag: etag,
pageSize: pageSize,
}
cmd.IsReadRequest = true
return cmd
}
func (c *GetRevisionsBinEntryCommand) createRequest(node *ServerNode) (*http.Request, error) {
etagStr := i64toa(c.etag)
url := node.URL + "/databases/" + node.Database + "/revisions/bin?etag=" + etagStr
if c.pageSize > 0 {
url += "&pageSize=" + strconv.Itoa(c.pageSize)
}
return newHttpGet(url)
}
func (c *GetRevisionsBinEntryCommand) setResponse(response []byte, fromCache bool) error {
if len(response) == 0 {
return throwInvalidResponse()
}
return jsonUnmarshal(response, &c.Result)
}
You can’t perform that action at this time.