Skip to content

Commit

Permalink
Share replication default
Browse files Browse the repository at this point in the history
  • Loading branch information
iddan authored and dennwc committed Nov 14, 2019
1 parent 1edd126 commit 9d2ac5c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions server/http/api_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,19 @@ import (
)

const (
prefix = "/api/v2"
defaultLimit = 100
prefix = "/api/v2"
defaultLimit = 100
defaultReplication = "single"
)

// NewAPIv2 creates a new instance of APIv2 with default options
func NewAPIv2(h *graph.Handle, wrappers ...HandlerWrapper) *APIv2 {
return NewAPIv2Writer(h, "single", nil, wrappers...)
return NewAPIv2Writer(h, defaultReplication, nil, wrappers...)
}

// NewBoundAPIv2 creates a new instance of APIv2 bound to a given httprouter.Router
func NewBoundAPIv2(h *graph.Handle, r *httprouter.Router) *APIv2 {
api := &APIv2{h: h, wtyp: "single", wopt: nil, limit: defaultLimit, handler: r}
api := &APIv2{h: h, wtyp: defaultReplication, wopt: nil, limit: defaultLimit, handler: r}
api.registerOn(r)
return api
}
Expand Down

0 comments on commit 9d2ac5c

Please sign in to comment.