-
Notifications
You must be signed in to change notification settings - Fork 1
/
payment.pb.micro.go
155 lines (130 loc) · 4.69 KB
/
payment.pb.micro.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: proto/payment/payment.proto
package payment
import (
fmt "fmt"
proto "google.golang.org/protobuf/proto"
math "math"
)
import (
context "context"
api "go-micro.dev/v4/api"
client "go-micro.dev/v4/client"
server "go-micro.dev/v4/server"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// Reference imports to suppress errors if they are not otherwise used.
var _ api.Endpoint
var _ context.Context
var _ client.Option
var _ server.Option
// Api Endpoints for Payment service
func NewPaymentEndpoints() []*api.Endpoint {
return []*api.Endpoint{}
}
// Client API for Payment service
type PaymentService interface {
AddPayment(ctx context.Context, in *PaymentInfo, opts ...client.CallOption) (*PaymentID, error)
UpdatePayment(ctx context.Context, in *PaymentInfo, opts ...client.CallOption) (*Response, error)
DeletePayment(ctx context.Context, in *PaymentID, opts ...client.CallOption) (*Response, error)
FindPaymentByID(ctx context.Context, in *PaymentID, opts ...client.CallOption) (*PaymentInfo, error)
FindAllPament(ctx context.Context, in *All, opts ...client.CallOption) (*PaymentAll, error)
}
type paymentService struct {
c client.Client
name string
}
func NewPaymentService(name string, c client.Client) PaymentService {
return &paymentService{
c: c,
name: name,
}
}
func (c *paymentService) AddPayment(ctx context.Context, in *PaymentInfo, opts ...client.CallOption) (*PaymentID, error) {
req := c.c.NewRequest(c.name, "Payment.AddPayment", in)
out := new(PaymentID)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *paymentService) UpdatePayment(ctx context.Context, in *PaymentInfo, opts ...client.CallOption) (*Response, error) {
req := c.c.NewRequest(c.name, "Payment.UpdatePayment", in)
out := new(Response)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *paymentService) DeletePayment(ctx context.Context, in *PaymentID, opts ...client.CallOption) (*Response, error) {
req := c.c.NewRequest(c.name, "Payment.DeletePayment", in)
out := new(Response)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *paymentService) FindPaymentByID(ctx context.Context, in *PaymentID, opts ...client.CallOption) (*PaymentInfo, error) {
req := c.c.NewRequest(c.name, "Payment.FindPaymentByID", in)
out := new(PaymentInfo)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *paymentService) FindAllPament(ctx context.Context, in *All, opts ...client.CallOption) (*PaymentAll, error) {
req := c.c.NewRequest(c.name, "Payment.FindAllPament", in)
out := new(PaymentAll)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for Payment service
type PaymentHandler interface {
AddPayment(context.Context, *PaymentInfo, *PaymentID) error
UpdatePayment(context.Context, *PaymentInfo, *Response) error
DeletePayment(context.Context, *PaymentID, *Response) error
FindPaymentByID(context.Context, *PaymentID, *PaymentInfo) error
FindAllPament(context.Context, *All, *PaymentAll) error
}
func RegisterPaymentHandler(s server.Server, hdlr PaymentHandler, opts ...server.HandlerOption) error {
type payment interface {
AddPayment(ctx context.Context, in *PaymentInfo, out *PaymentID) error
UpdatePayment(ctx context.Context, in *PaymentInfo, out *Response) error
DeletePayment(ctx context.Context, in *PaymentID, out *Response) error
FindPaymentByID(ctx context.Context, in *PaymentID, out *PaymentInfo) error
FindAllPament(ctx context.Context, in *All, out *PaymentAll) error
}
type Payment struct {
payment
}
h := &paymentHandler{hdlr}
return s.Handle(s.NewHandler(&Payment{h}, opts...))
}
type paymentHandler struct {
PaymentHandler
}
func (h *paymentHandler) AddPayment(ctx context.Context, in *PaymentInfo, out *PaymentID) error {
return h.PaymentHandler.AddPayment(ctx, in, out)
}
func (h *paymentHandler) UpdatePayment(ctx context.Context, in *PaymentInfo, out *Response) error {
return h.PaymentHandler.UpdatePayment(ctx, in, out)
}
func (h *paymentHandler) DeletePayment(ctx context.Context, in *PaymentID, out *Response) error {
return h.PaymentHandler.DeletePayment(ctx, in, out)
}
func (h *paymentHandler) FindPaymentByID(ctx context.Context, in *PaymentID, out *PaymentInfo) error {
return h.PaymentHandler.FindPaymentByID(ctx, in, out)
}
func (h *paymentHandler) FindAllPament(ctx context.Context, in *All, out *PaymentAll) error {
return h.PaymentHandler.FindAllPament(ctx, in, out)
}