Skip to content

Commit

Permalink
Merge pull request #134 from checkr/zz/add-offset-support
Browse files Browse the repository at this point in the history
Add offset support
  • Loading branch information
zhouzhuojie authored Jun 26, 2018
2 parents 7cf9a20 + 0f71984 commit 39caa34
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 5 deletions.
9 changes: 8 additions & 1 deletion docs/api_docs/bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ info:
Flagr is a feature flagging, A/B testing and dynamic configuration
microservice
title: Flagr
version: 1.0.0
version: 1.0.7
tags:
- name: flag
description: Everything about the flag
Expand Down Expand Up @@ -60,6 +60,13 @@ paths:
name: description_like
type: string
description: return flags partially matching given description
- in: query
name: offset
type: integer
format: int64
description: >-
return flags given the offset, it should usually set together with
limit
responses:
'200':
description: list all the flags
Expand Down
3 changes: 3 additions & 0 deletions pkg/handler/crud.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ func (c *crud) FindFlags(params flag.FindFlagsParams) middleware.Responder {
if params.Limit != nil {
q = q.Limit(int(*params.Limit))
}
if params.Offset != nil {
q = q.Offset(int(*params.Offset))
}

err := q.All(&fs)
if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions swagger/flags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ get:
name: description_like
type: string
description: return flags partially matching given description
- in: query
name: offset
type: integer
format: int64
description: return flags given the offset, it should usually set together with limit
responses:
200:
description: list all the flags
Expand Down
2 changes: 1 addition & 1 deletion swagger/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ swagger: "2.0"
info:
description: Flagr is a feature flagging, A/B testing and dynamic configuration microservice
title: Flagr
version: 1.0.0
version: 1.0.7
tags:
- name: flag
description: Everything about the flag
Expand Down
2 changes: 1 addition & 1 deletion swagger_gen/restapi/doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 16 additions & 2 deletions swagger_gen/restapi/embedded_spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions swagger_gen/restapi/operations/flag/find_flags_parameters.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions swagger_gen/restapi/operations/flag/find_flags_urlbuilder.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 39caa34

Please sign in to comment.