Documentation ¶
Overview ¶
Package redtiger contains the provider implementation for Red Tiger games with wallet api and user authentication.
Index ¶
- Constants
- func NewOperatorRouter(config configs.ProviderConf) *provider.Router
- func NewProviderRouter(config configs.ProviderConf, controller Controller) (*provider.Router, error)
- type AuthConf
- type AuthRequest
- type AuthResponse
- type AuthResponseWrapper
- type Balance
- type BaseRequest
- type BaseResponse
- type Controller
- type Error
- type ErrorResponse
- type Game
- type GameLaunchRequest
- type Jackpot
- type JackpotMoney
- type Money
- type PayoutDetails
- type PayoutRequest
- type PayoutResponse
- type PayoutResponseWrapper
- type Promo
- type ProviderController
- func (ctrl *ProviderController) Auth(c *fiber.Ctx) error
- func (ctrl *ProviderController) Payout(c *fiber.Ctx) error
- func (ctrl *ProviderController) PromoBuyin(c *fiber.Ctx) error
- func (ctrl *ProviderController) PromoRefund(c *fiber.Ctx) error
- func (ctrl *ProviderController) PromoSettle(c *fiber.Ctx) error
- func (ctrl *ProviderController) Refund(c *fiber.Ctx) error
- func (ctrl *ProviderController) Stake(c *fiber.Ctx) error
- type RTErrorCode
- type RedTigerService
- type RefundRequest
- type RefundResponseWrapper
- type RefundResult
- type Response
- type Round
- type Service
- type Sources
- type StakeDetails
- type StakeRequest
- type StakeResponse
- type StakeResponseWrapper
- type TransactionPayout
- type TransactionStake
- type WalletService
- func (s *WalletService) Auth(req AuthRequest) (*AuthResponseWrapper, *ErrorResponse)
- func (s *WalletService) Payout(req PayoutRequest) (*PayoutResponseWrapper, *ErrorResponse)
- func (s *WalletService) PromoBuyin(req StakeRequest) (*StakeResponseWrapper, *ErrorResponse)
- func (s *WalletService) PromoRefund(req RefundRequest) (*RefundResponseWrapper, *ErrorResponse)
- func (s *WalletService) PromoSettle(req PayoutRequest) (*PayoutResponseWrapper, *ErrorResponse)
- func (s *WalletService) Refund(req RefundRequest) (*RefundResponseWrapper, *ErrorResponse)
- func (s *WalletService) Stake(req StakeRequest) (*StakeResponseWrapper, *ErrorResponse)
- func (s *WalletService) WithContext(ctx context.Context) Service
Constants ¶
const (
ProviderName = "redtiger"
)
Variables ¶
This section is empty.
Functions ¶
func NewOperatorRouter ¶
func NewOperatorRouter(config configs.ProviderConf) *provider.Router
NewOperatorRouter Routes operator calls to execute actions toward the provider
func NewProviderRouter ¶
func NewProviderRouter(config configs.ProviderConf, controller Controller) (*provider.Router, error)
Types ¶
type AuthConf ¶
type AuthConf struct { APIKey string `mapstructure:"api_key"` ReconToken string `mapstructure:"recon_token,omitempty"` }
AuthConf Redtiger specific Auth configuration from valkyrie config file
func GetAuthConf ¶
func GetAuthConf(c configs.ProviderConf) (AuthConf, error)
GetAuthConf parse provider specific auth configuration
type AuthRequest ¶
type AuthRequest struct { BaseRequest Channel string `json:"channel,omitempty" validate:"max=8"` Affiliate string `json:"affiliate,omitempty" validate:"max=255"` Extras string `json:"extras,omitempty"` }
RT auth request
type AuthResponse ¶
type AuthResponse struct { BaseResponse UserID string `json:"userId" validate:"max=32"` Casino string `json:"casino" validate:"max=50"` Country string `json:"country" validate:"len=2"` Language string `json:"language" validate:"max=6" ` Balance Balance `json:"balance"` }
RT auth result object
type AuthResponseWrapper ¶
type AuthResponseWrapper struct { Error *Error `json:"error,omitempty"` Result AuthResponse `json:"result,omitempty"` Success bool `json:"success"` }
RT auth response
type BaseRequest ¶
type BaseRequest struct { Token string `json:"token" validate:"required,min=32,max=128"` UserID string `json:"userId" validate:"max=36"` Casino string `json:"casino" validate:"max=50"` Currency string `json:"currency" validate:"max=8"` IP string `json:"ip"` }
RT base request and response
type BaseResponse ¶
type Controller ¶
type Error ¶
type Error struct { Message string `json:"message"` Code RTErrorCode `json:"code"` }
type ErrorResponse ¶
RT error response
type GameLaunchRequest ¶
type GameLaunchRequest struct { Token string `url:"token"` Currency string `url:"currency,omitempty"` UserID string `url:"userId,omitempty"` LobbyURL string `url:"lobbyUrl,omitempty"` DepositURL string `url:"depositUrl,omitempty"` Affiliate string `url:"affiliate,omitempty"` Channel string `url:"channel,omitempty"` Casino string `url:"casino,omitempty"` }
type JackpotMoney ¶
func (JackpotMoney) Equal ¶
func (m JackpotMoney) Equal(b JackpotMoney) bool
func (JackpotMoney) MarshalJSON ¶
func (m JackpotMoney) MarshalJSON() ([]byte, error)
func (*JackpotMoney) UnmarshalJSON ¶
func (m *JackpotMoney) UnmarshalJSON(data []byte) error
type PayoutDetails ¶
type PayoutDetails struct { Game Money `json:"game"` Jackpot JackpotMoney `json:"jackpot"` }
type PayoutRequest ¶
type PayoutRequest struct { BaseRequest Transaction TransactionPayout `json:"transaction"` Game Game `json:"game"` Jackpot Jackpot `json:"jackpot"` Round Round `json:"round"` Promo Promo `json:"promo"` Retry bool `json:"retry"` }
RT payout stuff
type PayoutResponse ¶
type PayoutResponse struct { BaseResponse ID string `json:"id"` Payout Balance `json:"payout"` Balance Balance `json:"balance"` }
type PayoutResponseWrapper ¶
type PayoutResponseWrapper struct { Error *Error `json:"error,omitempty"` Result PayoutResponse `json:"result,omitempty"` Response }
type ProviderController ¶
type ProviderController struct {
// contains filtered or unexported fields
}
func NewProviderController ¶
func NewProviderController(service Service) *ProviderController
func (*ProviderController) Auth ¶
func (ctrl *ProviderController) Auth(c *fiber.Ctx) error
Auth handler function
func (*ProviderController) Payout ¶
func (ctrl *ProviderController) Payout(c *fiber.Ctx) error
Payout handler function
func (*ProviderController) PromoBuyin ¶
func (ctrl *ProviderController) PromoBuyin(c *fiber.Ctx) error
PromoBuyin handler function
func (*ProviderController) PromoRefund ¶
func (ctrl *ProviderController) PromoRefund(c *fiber.Ctx) error
PromoRefund handler function
func (*ProviderController) PromoSettle ¶
func (ctrl *ProviderController) PromoSettle(c *fiber.Ctx) error
PromoSettle handler function
func (*ProviderController) Refund ¶
func (ctrl *ProviderController) Refund(c *fiber.Ctx) error
Refund handler function
func (*ProviderController) Stake ¶
func (ctrl *ProviderController) Stake(c *fiber.Ctx) error
Stake handler function
type RTErrorCode ¶
type RTErrorCode int
const ( APIAuthError RTErrorCode = 100 InvalidInput RTErrorCode = 200 GenericError RTErrorCode = 201 NotAuthorized RTErrorCode = 301 UserNotFound RTErrorCode = 302 BannedUser RTErrorCode = 303 InsufficientFunds RTErrorCode = 304 InvalidUserCurrency RTErrorCode = 305 UserLimitedPlaying RTErrorCode = 306 TransactionNotFound RTErrorCode = 400 DuplicateTransaction RTErrorCode = 401 InternalServerError RTErrorCode = 500 UnderMaintenanceMode RTErrorCode = 501 )
type RedTigerService ¶ added in v0.6.0
type RedTigerService struct {
Conf *configs.ProviderConf
}
func (RedTigerService) GameLaunch ¶ added in v0.6.0
func (service RedTigerService) GameLaunch(_ *fiber.Ctx, g *provider.GameLaunchRequest, h *provider.GameLaunchHeaders) (string, error)
func (RedTigerService) GetGameRoundRender ¶ added in v0.6.0
func (service RedTigerService) GetGameRoundRender(*fiber.Ctx, provider.GameRoundRenderRequest) (string, error)
type RefundRequest ¶
type RefundRequest struct { BaseRequest Transaction TransactionStake `json:"transaction"` Game Game `json:"game"` Round Round `json:"round"` Promo Promo `json:"promo"` }
RT refund stuff
type RefundResponseWrapper ¶
type RefundResponseWrapper struct { Error *Error `json:"error,omitempty"` Result RefundResult `json:"result,omitempty"` Balance Balance `json:"balance"` Currency string `json:"currency"` Response }
type RefundResult ¶
type Service ¶
type Service interface { Auth(req AuthRequest) (*AuthResponseWrapper, *ErrorResponse) Stake(req StakeRequest) (*StakeResponseWrapper, *ErrorResponse) Payout(req PayoutRequest) (*PayoutResponseWrapper, *ErrorResponse) Refund(req RefundRequest) (*RefundResponseWrapper, *ErrorResponse) PromoBuyin(req StakeRequest) (*StakeResponseWrapper, *ErrorResponse) PromoSettle(req PayoutRequest) (*PayoutResponseWrapper, *ErrorResponse) PromoRefund(req RefundRequest) (*RefundResponseWrapper, *ErrorResponse) WithContext(ctx context.Context) Service }
type Sources ¶
type Sources struct { Jackpot map[string]JackpotMoney `json:"jackpot"` Lines Money `json:"lines"` Features Money `json:"features"` }
type StakeDetails ¶
type StakeRequest ¶
type StakeRequest struct { BaseRequest Transaction TransactionStake `json:"transaction"` Game Game `json:"game"` Round Round `json:"round"` Promo Promo `json:"promo,omitempty"` }
type StakeResponse ¶
type StakeResponse struct { BaseResponse ID string `json:"id"` Stake Balance `json:"stake"` Balance Balance `json:"balance"` }
type StakeResponseWrapper ¶
type StakeResponseWrapper struct { Error *Error `json:"error,omitempty"` Result StakeResponse `json:"result,omitempty"` Response }
type TransactionPayout ¶
type TransactionPayout struct { Sources Sources `json:"sources"` Details PayoutDetails `json:"details"` ID string `json:"id" validate:"max=32"` Payout Money `json:"payout" validate:"min=0"` PayoutPromo Money `json:"payoutPromo" validate:"min=0"` }
type TransactionStake ¶
type TransactionStake struct { ID string `json:"id" validate:"max=32"` Stake Money `json:"stake"` StakePromo Money `json:"stakePromo"` Details StakeDetails `json:"details"` }
type WalletService ¶ added in v0.6.0
type WalletService struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(pamClient pam.PamClient) *WalletService
NewService Create new red tiger provider service
func (*WalletService) Auth ¶ added in v0.6.0
func (s *WalletService) Auth(req AuthRequest) (*AuthResponseWrapper, *ErrorResponse)
Auth implements Service @Id RTAuth @Summary Auth @Description Authenticate toward Red tiger. @Tags Red Tiger @Accept json @Produce json @Param req body AuthRequest true "Request body" @Param Authorization header string true "API Key" @Success 200 {object} AuthResponseWrapper @Failure 400 {object} ErrorResponse @Router /providers/redtiger/auth [post]
func (*WalletService) Payout ¶ added in v0.6.0
func (s *WalletService) Payout(req PayoutRequest) (*PayoutResponseWrapper, *ErrorResponse)
Payout implements Service @Id RTPayout @Summary Payout @Description When a bet settles with a payout (credit). @Tags Red Tiger @Accept json @Produce json @Param req body PayoutRequest true "Request body" @Param Authorization header string true "API Key" @Success 200 {object} PayoutResponseWrapper @Failure 400 {object} ErrorResponse @Router /providers/redtiger/payout [post]
func (*WalletService) PromoBuyin ¶ added in v0.6.0
func (s *WalletService) PromoBuyin(req StakeRequest) (*StakeResponseWrapper, *ErrorResponse)
PromoBuyin implements Service @Id RTPromoBuyin @Summary PromoBuyin @Description Promotion buyin, request the same as stake/bet. @Tags Red Tiger @Accept json @Produce json @Param req body StakeRequest true "Request body" @Param Authorization header string true "API Key" @Success 200 {object} StakeResponseWrapper @Failure 400 {object} ErrorResponse @Router /providers/redtiger/promo/buyin [post]
func (*WalletService) PromoRefund ¶ added in v0.6.0
func (s *WalletService) PromoRefund(req RefundRequest) (*RefundResponseWrapper, *ErrorResponse)
PromoRefund implements Service @Id RTPromoRefund @Summary PromoRefund @Description Refund promotion buyin. @Tags Red Tiger @Accept json @Produce json @Param req body RefundRequest true "Request body" @Param Authorization header string true "API Key" @Success 200 {object} RefundResponseWrapper @Failure 400 {object} ErrorResponse @Router /providers/redtiger/promo/refund [post]
func (*WalletService) PromoSettle ¶ added in v0.6.0
func (s *WalletService) PromoSettle(req PayoutRequest) (*PayoutResponseWrapper, *ErrorResponse)
PromoSettle implements Service @Id RTPromoSettle @Summary PromoSettle @Description Promotion settlement for a placed buyin. @Tags Red Tiger @Accept json @Produce json @Param req body PayoutRequest true "Request body" @Param Authorization header string true "API Key" @Success 200 {object} PayoutResponseWrapper @Failure 400 {object} ErrorResponse @Router /providers/redtiger/promo/settle [post]
func (*WalletService) Refund ¶ added in v0.6.0
func (s *WalletService) Refund(req RefundRequest) (*RefundResponseWrapper, *ErrorResponse)
Refund implements Service @Id RTRefund @Summary Refund @Description Used to refund a placed bet. @Tags Red Tiger @Accept json @Produce json @Param req body RefundRequest true "Request body" @Param Authorization header string true "API Key" @Success 200 {object} RefundResponseWrapper @Failure 400 {object} ErrorResponse @Router /providers/redtiger/refund [post]
func (*WalletService) Stake ¶ added in v0.6.0
func (s *WalletService) Stake(req StakeRequest) (*StakeResponseWrapper, *ErrorResponse)
Stake implements Service @Id RTStake @Summary Stake @Description When a bet has been placed (debit). @Tags Red Tiger @Accept json @Produce json @Param req body StakeRequest true "Request body" @Param Authorization header string true "API Key" @Success 200 {object} StakeResponseWrapper @Failure 400 {object} ErrorResponse @Router /providers/redtiger/stake [post]
func (*WalletService) WithContext ¶ added in v0.6.0
func (s *WalletService) WithContext(ctx context.Context) Service