Pending
I. Google Wire for dependency injection
- only one method: wire.Build(struct1.New, struct2.New) normally, struct1 will be dependency of struct2 if struct2.New only required a field in struct1 -> use FieldsOf() after new struct1 if struct2’s input is an interface, we need to bind that interface to a struct just created in struct1.New
II. Spcli proto
- spcli proto gen
- spcli proto publish [–force] topic_name path/file_name.proto
III. Go confusing stuff
- Empty list is not a nil
- var a *A //
a := &A{} // &{ empty value each fields}
Draft
orders Item: .Stock .ItemType .PffInputPriceForced .SumStock .BundleDealInfo .ItemFulfillmentList
haveMultiWh
-> skip pre-check item stock for deducted items
IV. Go test
- go test package.go package_test.go -v -cover
- or move into package’s directory
- go test -cover -v coverage: go test -coveprofile=prof.out visualization: go tool cover -html=prof.out
V. SPEX stuff
export SP_UNIX_SOCKET=/tmp/spex.sock socat -d -d -d UNIX-LISTEN:/tmp/spex.sock,reuseaddr,fork TCP:agent-tcp.spex.test.shopee.io:9299 list out all env variables: env ? SPEX self call
- spex server: all about SPEX agen sps.Init() sps.registerProcessor() sps.Register()
- spex client sps.Init() sps.subscribeConfig() sps.Register()
service_info_path ./configs/spexservice/lostmodule.json SP_CONFIG_KEY c901206a990dff59fba338a6b6303dff SP_UNIX_SOCKET /tmp/spex.sock