You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
661 B
Go
39 lines
661 B
Go
// Code generated by goctl. DO NOT EDIT!
|
|
// Source: add.proto
|
|
|
|
//go:generate mockgen -destination ./adder_mock.go -package adder -source $GOFILE
|
|
|
|
package adder
|
|
|
|
import (
|
|
"context"
|
|
|
|
"bookstore/rpc/add/add"
|
|
|
|
"github.com/tal-tech/go-zero/zrpc"
|
|
)
|
|
|
|
type (
|
|
AddReq = add.AddReq
|
|
AddResp = add.AddResp
|
|
|
|
Adder interface {
|
|
Add(ctx context.Context, in *AddReq) (*AddResp, error)
|
|
}
|
|
|
|
defaultAdder struct {
|
|
cli zrpc.Client
|
|
}
|
|
)
|
|
|
|
func NewAdder(cli zrpc.Client) Adder {
|
|
return &defaultAdder{
|
|
cli: cli,
|
|
}
|
|
}
|
|
|
|
func (m *defaultAdder) Add(ctx context.Context, in *AddReq) (*AddResp, error) {
|
|
client := add.NewAdderClient(m.cli.Conn())
|
|
return client.Add(ctx, in)
|
|
}
|