Documentation ¶
Index ¶
- func ProxyRouter(reputationServer string, reputationToken string) http.HandlerFunc
- type Client
- type ClientWithPrometheus
- 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)
- type HTTPClient
- 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)
- type IsReputableOpts
- type IsWalletOnPlatformOpts
- type IsWalletOnPlatformResponse
- type IsWalletReputableResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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) IsWalletOnPlatform(ctx context.Context, id uuid.UUID, platform string) (bool, 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) IsWalletAdsReputable ¶ added in v0.5.0
func (_d ClientWithPrometheus) IsWalletAdsReputable(ctx context.Context, id uuid.UUID, platform string) (b1 bool, err error)
IsWalletAdsReputable implements Client
func (ClientWithPrometheus) IsWalletOnPlatform ¶ added in v0.4.0
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
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
HTTPClient wraps http.Client for interacting with the reputation server
func (*HTTPClient) IsWalletAdsReputable ¶ added in v0.5.0
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 ¶ added in v0.4.0
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
type IsReputableOpts ¶ added in v0.4.0
type IsReputableOpts struct {
Platform string `url:"platform"`
}
IsReputableOpts - the query string options for the is reputable api call
func (*IsReputableOpts) GenerateQueryString ¶ added in v0.5.0
func (iro *IsReputableOpts) GenerateQueryString() (url.Values, error)
GenerateQueryString - implement the QueryStringBody interface
type IsWalletOnPlatformOpts ¶ added in v0.4.0
type IsWalletOnPlatformOpts struct {
PriorTo string `url:"priorTo"`
}
IsWalletOnPlatformOpts - the query string options for the is reputable api call
func (*IsWalletOnPlatformOpts) GenerateQueryString ¶ added in v0.5.0
func (iwopo *IsWalletOnPlatformOpts) GenerateQueryString() (url.Values, error)
GenerateQueryString - implement the QueryStringBody interface
type IsWalletOnPlatformResponse ¶ added in v0.4.0
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