examples

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ItemTypeLuxury = "LUXURY"
	ItemTypeNormal = "NORMAL"
)

Variables

View Source
var (
	PriceCheckRule = `` /* 507-byte string literal not displayed */

)
View Source
var (
	Purchases = []*Purchase{
		&Purchase{
			PurchaseDate: time.Date(2019, time.January, 4, 13, 0, 0, 0, time.Local),
			ItemType:     ItemTypeLuxury,
			Price:        100000,
		},
		&Purchase{
			PurchaseDate: time.Date(2019, time.January, 17, 15, 0, 0, 0, time.Local),
			ItemType:     ItemTypeLuxury,
			Price:        100000,
		},
		&Purchase{
			PurchaseDate: time.Date(2019, time.February, 12, 7, 0, 0, 0, time.Local),
			ItemType:     ItemTypeLuxury,
			Price:        100000,
		},
		&Purchase{
			PurchaseDate: time.Date(2019, time.February, 24, 3, 0, 0, 0, time.Local),
			ItemType:     ItemTypeLuxury,
			Price:        100000,
		},
		&Purchase{
			PurchaseDate: time.Date(2019, time.March, 22, 22, 0, 0, 0, time.Local),
			ItemType:     ItemTypeLuxury,
			Price:        100000,
		},
		&Purchase{
			PurchaseDate: time.Date(2019, time.March, 24, 17, 0, 0, 0, time.Local),
			ItemType:     ItemTypeLuxury,
			Price:        100000,
		},
		&Purchase{
			PurchaseDate: time.Date(2019, time.March, 15, 14, 0, 0, 0, time.Local),
			ItemType:     ItemTypeLuxury,
			Price:        100000,
		},
		&Purchase{
			PurchaseDate: time.Date(2019, time.March, 25, 10, 0, 0, 0, time.Local),
			ItemType:     ItemTypeLuxury,
			Price:        100000,
		},
		&Purchase{
			PurchaseDate: time.Date(2019, time.March, 19, 13, 0, 0, 0, time.Local),
			ItemType:     ItemTypeLuxury,
			Price:        100000,
		},
		&Purchase{
			PurchaseDate: time.Date(2019, time.June, 6, 21, 0, 0, 0, time.Local),
			ItemType:     ItemTypeLuxury,
			Price:        100000,
		},
		&Purchase{
			PurchaseDate: time.Date(2019, time.June, 19, 22, 0, 0, 0, time.Local),
			ItemType:     ItemTypeLuxury,
			Price:        100000,
		},
	}
)

Functions

This section is empty.

Types

type CashFlow

type CashFlow struct {
	TotalPurchases    float64
	PurchaseCount     int
	TotalTax          float64
	PurchasesAfterTax float64
}

func (*CashFlow) String

func (cf *CashFlow) String() string

type CashFlowCalculator

type CashFlowCalculator struct {
}

func (*CashFlowCalculator) CalculatePurchases

func (cf *CashFlowCalculator) CalculatePurchases()

type Item

type Item struct {
	Name     string
	Price    int64
	Discount int64
}

type ItemCart

type ItemCart struct {
	Items []*Item
}

func (*ItemCart) CountItemWithPriceAboveWithNoDiscount

func (cart *ItemCart) CountItemWithPriceAboveWithNoDiscount(minimumPrice int64) int

func (*ItemCart) GiveDiscountForItemPriceAbove

func (cart *ItemCart) GiveDiscountForItemPriceAbove(minimumPrice int64, discount int64)

func (*ItemCart) ShowDiscount

func (cart *ItemCart) ShowDiscount()

type ItemPriceChecker

type ItemPriceChecker struct {
}

func (*ItemPriceChecker) CheckCart

func (cf *ItemPriceChecker) CheckCart()

func (*ItemPriceChecker) CheckPrices

func (cf *ItemPriceChecker) CheckPrices()

type MyPoGo

type MyPoGo struct {
}

func (*MyPoGo) Compare

func (p *MyPoGo) Compare(t1, t2 string) bool

func (*MyPoGo) GetStringLength

func (p *MyPoGo) GetStringLength(sarg string) int

type Purchase

type Purchase struct {
	PurchaseDate time.Time
	ItemType     string
	Price        float64

	Tax             float64
	PriceAfterTax   float64
	IgnoredPurchase bool
}

type User

type User struct {
	Name string
	Age  int
	Male bool
}

Jump to

Keyboard shortcuts

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