first_try

package
v0.0.0-...-abea9b8 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2022 License: MIT Imports: 2 Imported by: 0

README

Try implementing simple design of sniper bot from GOOS book proposed by Vladimir Khorikov article https://enterprisecraftsmanship.com/posts/growing-object-oriented-software-guided-by-tests-without-mocks/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PriceEvent

type PriceEvent struct {
	MinimalIncrement int
	NewPrice         int
	IsOurBid         bool
}

type Sniper

type Sniper struct {
	ItemID    string
	StopPrice int
	State     State
	LastPrice int
	LastBid   int
}

func NewSniper

func NewSniper(itemID string, stopPrice int) Sniper

func (*Sniper) AuctionClosed

func (sniper *Sniper) AuctionClosed()

func (*Sniper) PriceReceived

func (sniper *Sniper) PriceReceived(event PriceEvent)

type State

type State string
const (
	Joining State = "JOINING"
	Bidding State = "BIDDING"
	Losing  State = "LOSING"
	Lost    State = "LOST"
	Winning State = "WINNING"
	Won     State = "WON"
)

Jump to

Keyboard shortcuts

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