pricing

package
v4.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FIXED_METHOD_PRICING = "fixed_price_per_method"
	FIXED_PRICING        = "fixed_price"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FixedMethodPrice

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

func (FixedMethodPrice) GetPrice

func (priceType FixedMethodPrice) GetPrice(GrpcContext *handler.GrpcStreamContext) (price *big.Int, err error)

type FixedPrice

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

func (FixedPrice) GetPrice

func (priceType FixedPrice) GetPrice(GrpcContext *handler.GrpcStreamContext) (price *big.Int, err error)

type PriceType

type PriceType interface {

	//Based on the user input determine how will the price be determined
	GetPrice(GrpcContext *handler.GrpcStreamContext) (price *big.Int, err error)
}

Based on the request passed, a particular strategy will be picked up for processing

type PricingStrategy

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

func InitPricingStrategy

func InitPricingStrategy(metadata *blockchain.ServiceMetadata) (*PricingStrategy, error)

Initialize all the pricing types

func (*PricingStrategy) AddPricingTypes

func (pricing *PricingStrategy) AddPricingTypes(priceType PriceType)

func (PricingStrategy) GetPrice

func (pricing PricingStrategy) GetPrice(GrpcContext *handler.GrpcStreamContext) (price *big.Int, err error)

Jump to

Keyboard shortcuts

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