handler

package
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2018 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAccountDetailsHandler added in v1.2.0

func GetAccountDetailsHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

GetAccountDetailsHandler uses BaseAPI for get conversion details by it id. Query parameters ID is required.

func GetAccountsHandler added in v1.2.0

func GetAccountsHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

GetAccountsHandler uses BaseAPI for search and list accounts. Query parameters: Query, Limit, Offset can be optional. Query - MongoDB query string. Limit - maximum 500 items. Offset - default 0.

func GetConversionDetailsHandler

func GetConversionDetailsHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

GetConversionDetailsHandler uses BaseAPI for get conversion details by it id. Query parameters ID is required.

func GetConversionsHandler

func GetConversionsHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

GetConversionsHandler uses BaseAPI for search and list conversions. Query parameters: Query, Limit, Offset can be optional. Query - MongoDB query string. Limit - maximum 500 items. Offset - default 0.

func GetTransitionDetailsHandler

func GetTransitionDetailsHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

GetTransitionDetailsHandler uses BaseAPI for get transition details by it id. Query parameters ID is required.

func GetTransitionsHandler

func GetTransitionsHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

GetTransitionsHandler uses BaseAPI for search and list transitions. Query parameters: Query, Limit, Offset can be optional. Query - MongoDB query string. Limit - maximum 500 items. Offset - default 0.

func PostAccountsHandler

func PostAccountsHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

PostAccountsHandler uses FastAPI for sends new accounts requests in async mode to blockchain

func PostConversionsHandler

func PostConversionsHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

PostConversionsHandler uses FastAPI for sends new conversions requests in async mode to blockchain

func PostTransitionsHandler

func PostTransitionsHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

PostTransitionsHandler uses FastAPI for sends new transitions requests in async mode to blockchain

func SetEndpoint

func SetEndpoint(addr string)

SetEndpoint method defines validator GRPC address

Types

type Account

type Account struct {
	ID   string `json:"id" mapstructure:"id"`
	Priv string `json:"private_key" mapstructure:"private_key"`
	Pub  string `json:"public_key" mapstructure:"public_key"`
}

Account struct describes account related fields

ID - unique identifier of account in blockchain Priv - private key of account Pub - public key of account

type Conversion

type Conversion struct {
	AdvertiserAccountID string `json:"advertiser_account_id" mapstructure:"advertiser_account_id" bson:"advertiser_account_id"`
	AffiliateAccountID  string `json:"affiliate_account_id" mapstructure:"affiliate_account_id" bson:"affiliate_account_id"`
	ClickID             string `json:"click_id" mapstructure:"click_id" bson:"click_id"`
	StreamID            string `json:"stream_id" mapstructure:"stream_id" bson:"stream_id"`
	OfferID             string `json:"offer_id" mapstructure:"offer_id" bson:"offer_id"`
	ClientID            string `json:"client_id" mapstructure:"client_id" bson:"client_id"`
	GoalID              string `json:"goal_id" mapstructure:"goal_id" bson:"goal_id"`
	Comment             string `json:"comment" mapstructure:"comment,omitempty" bson:"comment"`
	Status              string `json:"status" mapstructure:"status" bson:"status"`
}

Conversion struct describes conversion related fields All fields, except AdvertiserAccountID and AffiliateAccountID are optional.

AdvertiserAccountID - unique identifier of advertiser account AffiliateAccountID - unique identifier of affiliate account ClickID - unique identifier of user's click (usually transmitted from affiliate network) StreamID (a.k.a. PlatformID) - uniques identifier of webmaster's platform in afiliate network OfferID - unique identifier of offer in affiliate network ClientID - unique identifer of client in CRM (database) of advertiser GoalID - type of conversion in affiliate network (maybe any, like: "per lead, filled form or so on...") Comment - commentary from advertiser for current conversion Status - status of conversion (PENDING, DECLINED, CONFIRMED)

type Request

type Request struct {
	AccountID string      `json:"account_id,omitempty"`
	PrivKey   string      `json:"private_key,omitempty"`
	PubKey    string      `json:"public_key,omitempty"`
	Data      interface{} `json:"data"`
}

Request struct represents request related fields

AccountID - unique identifier of request-maker in blockchain PrivKey - private key of account PubKey - public key of account Data - arbitrary passed data (maybe any supported in system)

type Transition

type Transition struct {
	AdvertiserAccountID string `json:"advertiser_account_id" mapstructure:"advertiser_account_id"`
	AffiliateAccountID  string `json:"affiliate_account_id" mapstructure:"affiliate_account_id"`
	ClickID             string `json:"click_id" mapstructure:"click_id"`
	StreamID            string `json:"stream_id" mapstructure:"stream_id"`
	OfferID             string `json:"offer_id" mapstructure:"offer_id"`
	ExpiresIn           int64  `json:"expires_in" mapstructure:"expires_in"`
}

Transition struct describes transition related fields All fields, except AdvertiserAccountID and AffiliateAccountID are optional.

AdvertiserAccountID - unique identifier of advertiser account AffiliateAccountID - unique identifier of affiliate account ClickID - unique identifier of user's click (usually transmitted from affiliate network) StreamID (a.k.a. PlatformID) - uniques identifier of webmaster's platform in afiliate network OfferID - unique identifier of offer in affiliate network ExpiresIn - Unix timestamp of transition expiration (in seconds)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL