test(utils): 添加事件驱动模型测试
- 在 sqrt_test.go 中添加了 fastSqr1 测试函数,用于测试事件驱动模型 - 新增了 Event 和 Uint32AsyncEvent 类型用于测试 - 更新了 go.work、go.mod 和
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package inventory
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
type ServiceClient interface {
|
||||
GetStockForProduct(ctx context.Context, in *ProductIDRequest) (*ProductStockResponse, error) // , opts ...grpc.CallOption) (*ProductStockResponse, error)
|
||||
}
|
||||
|
||||
type ProductIDRequest struct {
|
||||
ID string
|
||||
}
|
||||
|
||||
type ProductStockResponse struct {
|
||||
Stock float64
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package inventory
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
type ServiceImpl struct {
|
||||
}
|
||||
|
||||
func NewService() ServiceImpl {
|
||||
result := ServiceImpl{}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
func (s *ServiceImpl) GetStockForProduct(ctx context.Context, productID string) {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user