Documentation ¶
Index ¶
- Variables
- func ProxyRouter(reputationServer string, reputationToken string) http.HandlerFunc
- type Client
- type ClientWithPrometheus
- func (_d ClientWithPrometheus) GetReputationSummary(ctx context.Context, paymentID uuid.UUID) (r1 RepSummaryResponse, err error)
- func (_d ClientWithPrometheus) IsDrainReputable(ctx context.Context, id uuid.UUID, promotionID uuid.UUID, ...) (b1 bool, ia1 []int, err error)
- func (_d ClientWithPrometheus) IsLinkingReputable(ctx context.Context, id uuid.UUID, country string) (b1 bool, ia1 []int, err error)
- func (_d ClientWithPrometheus) IsWalletAdsReputable(ctx context.Context, id uuid.UUID, platform string) (b1 bool, err error)
- func (_d ClientWithPrometheus) IsWalletOnPlatform(ctx context.Context, id uuid.UUID, platform string) (b1 bool, err error)
- func (_d ClientWithPrometheus) IsWalletReputable(ctx context.Context, id uuid.UUID, platform string) (b1 bool, err error)
- func (_d ClientWithPrometheus) UpdateReputationSummary(ctx context.Context, paymentID string, verifiedWallet bool) (err error)
- func (_d ClientWithPrometheus) UpsertReputationSummary(ctx context.Context, paymentID string, geoCountry string) (err error)
- type HTTPClient
- func (c *HTTPClient) GetReputationSummary(ctx context.Context, paymentID uuid.UUID) (RepSummaryResponse, error)
- func (c *HTTPClient) IsDrainReputable(ctx context.Context, paymentID, promotionID uuid.UUID, ...) (bool, []int, error)
- func (c *HTTPClient) IsLinkingReputable(ctx context.Context, paymentID uuid.UUID, country string) (bool, []int, error)
- func (c *HTTPClient) IsWalletAdsReputable(ctx context.Context, paymentID uuid.UUID, platform string) (bool, error)
- func (c *HTTPClient) IsWalletOnPlatform(ctx context.Context, paymentID uuid.UUID, platform string) (bool, error)
- func (c *HTTPClient) IsWalletReputable(ctx context.Context, paymentID uuid.UUID, platform string) (bool, error)
- func (c *HTTPClient) UpdateReputationSummary(ctx context.Context, paymentID string, verifiedWallet bool) error
- func (c *HTTPClient) UpsertReputationSummary(ctx context.Context, paymentID, geoCountry string) error
- type IsDrainReputableOpts
- type IsLinkingReputableRequestQSB
- type IsReputableOpts
- type IsReputableResponse
- type IsWalletOnPlatformOpts
- type IsWalletOnPlatformResponse
- type IsWalletReputableResponse
- type RepSummaryResponse
Constants ¶
This section is empty.
Variables ¶
var ( // CohortNil - bad cohort CohortNil int // CohortOK - ok cohort CohortOK = 1 )
Functions ¶
func ProxyRouter ¶
func ProxyRouter( reputationServer string, reputationToken string, ) http.HandlerFunc
ProxyRouter is a reverse proxy to reputation endpoints for client access
Types ¶
type Client ¶
type Client interface { IsWalletReputable(ctx context.Context, id uuid.UUID, platform string) (bool, error) IsWalletAdsReputable(ctx context.Context, id uuid.UUID, platform string) (bool, error) IsDrainReputable(ctx context.Context, id, promotionID uuid.UUID, withdrawAmount decimal.Decimal) (bool, []int, error) IsLinkingReputable(ctx context.Context, id uuid.UUID, country string) (bool, []int, error) IsWalletOnPlatform(ctx context.Context, id uuid.UUID, platform string) (bool, error) UpsertReputationSummary(ctx context.Context, paymentID, geoCountry string) error UpdateReputationSummary(ctx context.Context, paymentID string, verifiedWallet bool) error GetReputationSummary(ctx context.Context, paymentID uuid.UUID) (RepSummaryResponse, error) }
Client abstracts over the underlying client
type ClientWithPrometheus ¶
type ClientWithPrometheus struct {
// contains filtered or unexported fields
}
ClientWithPrometheus implements Client interface with all methods wrapped with Prometheus metrics
func NewClientWithPrometheus ¶
func NewClientWithPrometheus(base Client, instanceName string) ClientWithPrometheus
NewClientWithPrometheus returns an instance of the Client decorated with prometheus summary metric
func (ClientWithPrometheus) GetReputationSummary ¶
func (_d ClientWithPrometheus) GetReputationSummary(ctx context.Context, paymentID uuid.UUID) (r1 RepSummaryResponse, err error)
GetReputationSummary implements Client
func (ClientWithPrometheus) IsDrainReputable ¶
func (_d ClientWithPrometheus) IsDrainReputable(ctx context.Context, id uuid.UUID, promotionID uuid.UUID, withdrawAmount decimal.Decimal) (b1 bool, ia1 []int, err error)
IsDrainReputable implements Client
func (ClientWithPrometheus) IsLinkingReputable ¶
func (_d ClientWithPrometheus) IsLinkingReputable(ctx context.Context, id uuid.UUID, country string) (b1 bool, ia1 []int, err error)
IsLinkingReputable implements Client
func (ClientWithPrometheus) IsWalletAdsReputable ¶
func (_d ClientWithPrometheus) IsWalletAdsReputable(ctx context.Context, id uuid.UUID, platform string) (b1 bool, err error)
IsWalletAdsReputable implements Client
func (ClientWithPrometheus) IsWalletOnPlatform ¶
func (_d ClientWithPrometheus) IsWalletOnPlatform(ctx context.Context, id uuid.UUID, platform string) (b1 bool, err error)
IsWalletOnPlatform implements Client
func (ClientWithPrometheus) IsWalletReputable ¶
func (_d ClientWithPrometheus) IsWalletReputable(ctx context.Context, id uuid.UUID, platform string) (b1 bool, err error)
IsWalletReputable implements Client
func (ClientWithPrometheus) UpdateReputationSummary ¶
func (_d ClientWithPrometheus) UpdateReputationSummary(ctx context.Context, paymentID string, verifiedWallet bool) (err error)
UpdateReputationSummary implements Client
func (ClientWithPrometheus) UpsertReputationSummary ¶
func (_d ClientWithPrometheus) UpsertReputationSummary(ctx context.Context, paymentID string, geoCountry string) (err error)
UpsertReputationSummary implements Client
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
HTTPClient wraps http.Client for interacting with the reputation server
func (*HTTPClient) GetReputationSummary ¶
func (c *HTTPClient) GetReputationSummary(ctx context.Context, paymentID uuid.UUID) (RepSummaryResponse, error)
func (*HTTPClient) IsDrainReputable ¶
func (c *HTTPClient) IsDrainReputable( ctx context.Context, paymentID, promotionID uuid.UUID, withdrawalAmount decimal.Decimal, ) (bool, []int, error)
IsDrainReputable makes the request to the reputation server and returns whether a paymentId has enough reputation to claim a grant
func (*HTTPClient) IsLinkingReputable ¶
func (c *HTTPClient) IsLinkingReputable( ctx context.Context, paymentID uuid.UUID, country string, ) (bool, []int, error)
IsLinkingReputable makes the request to the reputation server and returns whether a paymentId has enough reputation to claim a grant
func (*HTTPClient) IsWalletAdsReputable ¶
func (c *HTTPClient) IsWalletAdsReputable( ctx context.Context, paymentID uuid.UUID, platform string, ) (bool, error)
IsWalletAdsReputable makes the request to the reputation server and returns whether a paymentId has enough reputation to claim a grant
func (*HTTPClient) IsWalletOnPlatform ¶
func (c *HTTPClient) IsWalletOnPlatform( ctx context.Context, paymentID uuid.UUID, platform string, ) (bool, error)
IsWalletOnPlatform makes the request to the reputation server and returns whether a paymentId is on a given platform
func (*HTTPClient) IsWalletReputable ¶
func (c *HTTPClient) IsWalletReputable( ctx context.Context, paymentID uuid.UUID, platform string, ) (bool, error)
IsWalletReputable makes the request to the reputation server and returns whether a paymentId has enough reputation to claim a grant
func (*HTTPClient) UpdateReputationSummary ¶
func (c *HTTPClient) UpdateReputationSummary(ctx context.Context, paymentID string, verifiedWallet bool) error
UpdateReputationSummary calls the reputation summary update endpoint with the values.
func (*HTTPClient) UpsertReputationSummary ¶
func (c *HTTPClient) UpsertReputationSummary(ctx context.Context, paymentID, geoCountry string) error
UpsertReputationSummary calls the reputation summary upsert endpoint and creates or updates the reputation summary identified by the paymentID with the given geo country.
type IsDrainReputableOpts ¶
type IsDrainReputableOpts struct { WithdrawalAmount string `url:"withdrawal_amount"` PromotionID string `url:"promotion_id"` }
IsDrainReputableOpts - the query string options for the is reputable api call
func (*IsDrainReputableOpts) GenerateQueryString ¶
func (iro *IsDrainReputableOpts) GenerateQueryString() (url.Values, error)
GenerateQueryString - implement the QueryStringBody interface
type IsLinkingReputableRequestQSB ¶
type IsLinkingReputableRequestQSB struct {
Country string `url:"country,omitempty"`
}
IsLinkingReputableRequestQSB - query string "body" for is linking reputable requests
func (*IsLinkingReputableRequestQSB) GenerateQueryString ¶
func (ilrrqsb *IsLinkingReputableRequestQSB) GenerateQueryString() (url.Values, error)
GenerateQueryString - implement the QueryStringBody interface
type IsReputableOpts ¶
type IsReputableOpts struct {
Platform string `url:"platform"`
}
IsReputableOpts - the query string options for the is reputable api call
func (*IsReputableOpts) GenerateQueryString ¶
func (iro *IsReputableOpts) GenerateQueryString() (url.Values, error)
GenerateQueryString - implement the QueryStringBody interface
type IsReputableResponse ¶
type IsReputableResponse struct {
Cohorts []int `json:"cohorts"`
}
IsReputableResponse is what the reputation server will send back when we ask if a wallet is reputable
type IsWalletOnPlatformOpts ¶
type IsWalletOnPlatformOpts struct {
PriorTo string `url:"priorTo"`
}
IsWalletOnPlatformOpts - the query string options for the is reputable api call
func (*IsWalletOnPlatformOpts) GenerateQueryString ¶
func (iwopo *IsWalletOnPlatformOpts) GenerateQueryString() (url.Values, error)
GenerateQueryString - implement the QueryStringBody interface
type IsWalletOnPlatformResponse ¶
type IsWalletOnPlatformResponse struct {
IsOnPlatform bool `json:"isOnPlatform"`
}
IsWalletOnPlatformResponse - will send back indication if wallet is on said platform
type IsWalletReputableResponse ¶
type IsWalletReputableResponse struct {
IsReputable bool `json:"isReputable"`
}
IsWalletReputableResponse is what the reputation server will send back when we ask if a wallet is reputable
type RepSummaryResponse ¶
type RepSummaryResponse struct {
GeoCountry string `json:"geoCountry"`
}