Skip to content

Commit

Permalink
Adding docs for prosper/search.go (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtlynch committed Sep 25, 2016
1 parent ae420a5 commit 096cb78
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions prosper/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
)

type (
// SearchFilter specifies a filter for the types of listings to retrieve in
// the Search function.
SearchFilter struct {
EstimatedReturn types.Float64Range
IncomeRange []types.IncomeRange
Expand All @@ -20,18 +22,24 @@ type (
ListingStatus []types.ListingStatus
}

// SearchParams specifies parameters to the Search.
SearchParams struct {
Offset int
Limit int
ExcludeListingsInvested bool
Filter SearchFilter
}

// ListingSearcher is an interface that supports the Search API for active
// Prosper listings.
ListingSearcher interface {
Search(SearchParams) (types.SearchResponse, error)
}
)

// Search queries Prosper for current listings that match specified search
// parameters. Search implements the REST API described at:
// https://developers.prosper.com/docs/investor/searchlistings-api/
func (c Client) Search(p SearchParams) (response types.SearchResponse, err error) {
rawResponse, err := c.rawClient.Search(searchParamsToThinType(p))
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion prosper/thin/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type (
ListingStatus []int
}

// SearchParams specifies parameters to the Search
// SearchParams specifies parameters to the Search.
SearchParams struct {
Offset int
Limit int
Expand Down

0 comments on commit 096cb78

Please sign in to comment.