scenario

package
v0.0.0-...-d83ffce Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CorrectCardNumber = "AAAAAAAA"
	FailedCardNumber  = "FA10AAAA"
)
View Source
const (
	// シナリオ(1,2,3,4) = 並列数(1,2,2,1)
	// これを負荷の1単位とする
	// 1だとLoad内のfor loopが必要ないが、調整のため残す
	NumLoadScenario1 = 1
	NumLoadScenario2 = 2
	NumLoadScenario3 = 2
	NumLoadScenario4 = 1
)
View Source
const (
	MinCampaignRateSetting = 0
	MaxCampaignRateSetting = 4
)
View Source
const (
	ExecutionSeconds = 60
)

Variables

This section is empty.

Functions

func Campaign

func Campaign(ctx context.Context)

func Check

func Check(ctx context.Context)

func FinalCheck

func FinalCheck(ctx context.Context) int64

func InitSessionPool

func InitSessionPool()

func Initialize

func Initialize(ctx context.Context, paymentServiceURL, shipmentServiceURL string) (int, string)

func Load

func Load(ctx context.Context)

func SetPayment

func SetPayment(sp *server.ServerPayment)

func SetShipment

func SetShipment(ss *server.ServerShipment)

func Validation

func Validation(ctx context.Context, campaign int)

func Verify

func Verify(ctx context.Context)

Types

type IDsStore

type IDsStore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*IDsStore) Add

func (s *IDsStore) Add(id int64) error

func (*IDsStore) Len

func (s *IDsStore) Len() int

func (*IDsStore) RandomIDs

func (s *IDsStore) RandomIDs(num int) []int64

type Queue

type Queue struct {
	sync.Mutex
	// contains filtered or unexported fields
}
var (
	ActiveSellerPool *Queue
	BuyerPool        *Queue
)

func NewQueue

func NewQueue() *Queue

func (*Queue) Dequeue

func (q *Queue) Dequeue() *session.Session

func (*Queue) Enqueue

func (q *Queue) Enqueue(s *session.Session)

func (*Queue) Len

func (q *Queue) Len() int

Jump to

Keyboard shortcuts

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