example

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package example used for showing how a provide module can be implemented

Index

Constants

View Source
const ProviderName = "Example Game Provider"

Variables

This section is empty.

Functions

func NewExampleProviderService

func NewExampleProviderService(c configs.ProviderConf, httpClient rest.HTTPClientJSONInterface) *exampleProviderService

func NewOperatorRouter

func NewOperatorRouter(config configs.ProviderConf, httpClient rest.HTTPClientJSONInterface) *provider.Router

NewOperatorRouter sets up all endpoints that can be used by the operator to make requests toward the provider. The router should follow the oapi definition found in /provider/docs/operator_api.yml

func NewProviderRouter

func NewProviderRouter(config configs.ProviderConf, service *WalletService) (*provider.Router, error)

NewProviderRouter sets up the wallet api used by the Game provider.

Types

type AuthConf

type AuthConf struct {
	APIKey string `mapstructure:"api_key"`
}

AuthConf Example provider specific Auth configuration from valkyrie config file

func GetAuthConf

func GetAuthConf(c configs.ProviderConf) (AuthConf, error)

GetAuthConf parse provider specific auth configuration

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller use for setting up the wallet endpoint functions. Here request and header validation can be done. If you're using oapi-codegen, this part can be autogenerated. This is just an example of how the controller could be set up using generics.

func NewController

func NewController(walletService *WalletService) *Controller

func (*Controller) WalletBalanceEndpoint

func (c *Controller) WalletBalanceEndpoint(ctx *fiber.Ctx) error

type WalletService

type WalletService struct {
	// contains filtered or unexported fields
}

WalletService is used to map the providers wallet calls to Valkyrie PamClient.

func NewWalletService

func NewWalletService(pamClient pam.PamClient) *WalletService

func (*WalletService) GetBalance

func (ws *WalletService) GetBalance(br balanceRequest) *pam.Balance

Jump to

Keyboard shortcuts

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