/
client.microgen.go
197 lines (194 loc) · 5.94 KB
/
client.microgen.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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
// Code generated by microgen 1.0.5. DO NOT EDIT.
package transportgrpc
import (
grpckit "github.com/go-kit/kit/transport/grpc"
pb "github.com/nullc4t/auth-service/pkg/mgmt/proto"
transport "github.com/nullc4t/auth-service/pkg/mgmt/transport"
grpc "google.golang.org/grpc"
)
func NewGRPCClient(conn *grpc.ClientConn, addr string, opts ...grpckit.ClientOption) transport.EndpointsSet {
return transport.EndpointsSet{
AddUserPermissionEndpoint: grpckit.NewClient(
conn, addr, "AddUserPermission",
_Encode_AddUserPermission_Request,
_Decode_AddUserPermission_Response,
pb.AddUserPermissionResponse{},
opts...,
).Endpoint(),
AttachAccountToServiceEndpoint: grpckit.NewClient(
conn, addr, "AttachAccountToService",
_Encode_AttachAccountToService_Request,
_Decode_AttachAccountToService_Response,
pb.AttachAccountToServiceResponse{},
opts...,
).Endpoint(),
AttachUserToAccountEndpoint: grpckit.NewClient(
conn, addr, "AttachUserToAccount",
_Encode_AttachUserToAccount_Request,
_Decode_AttachUserToAccount_Response,
pb.AttachUserToAccountResponse{},
opts...,
).Endpoint(),
BlockUserEndpoint: grpckit.NewClient(
conn, addr, "BlockUser",
_Encode_BlockUser_Request,
_Decode_BlockUser_Response,
pb.BlockUserResponse{},
opts...,
).Endpoint(),
CreateAccountEndpoint: grpckit.NewClient(
conn, addr, "CreateAccount",
_Encode_CreateAccount_Request,
_Decode_CreateAccount_Response,
pb.CreateAccountResponse{},
opts...,
).Endpoint(),
CreateAccountWithNameEndpoint: grpckit.NewClient(
conn, addr, "CreateAccountWithName",
_Encode_CreateAccountWithName_Request,
_Decode_CreateAccountWithName_Response,
pb.CreateAccountWithNameResponse{},
opts...,
).Endpoint(),
CreatePermissionEndpoint: grpckit.NewClient(
conn, addr, "CreatePermission",
_Encode_CreatePermission_Request,
_Decode_CreatePermission_Response,
pb.CreatePermissionResponse{},
opts...,
).Endpoint(),
CreateServiceEndpoint: grpckit.NewClient(
conn, addr, "CreateService",
_Encode_CreateService_Request,
_Decode_CreateService_Response,
pb.CreateServiceResponse{},
opts...,
).Endpoint(),
CreateUserWithLoginPasswordEndpoint: grpckit.NewClient(
conn, addr, "CreateUserWithLoginPassword",
_Encode_CreateUserWithLoginPassword_Request,
_Decode_CreateUserWithLoginPassword_Response,
pb.CreateUserWithLoginPasswordResponse{},
opts...,
).Endpoint(),
CreateUserWithTelegramEndpoint: grpckit.NewClient(
conn, addr, "CreateUserWithTelegram",
_Encode_CreateUserWithTelegram_Request,
_Decode_CreateUserWithTelegram_Response,
pb.CreateUserWithTelegramResponse{},
opts...,
).Endpoint(),
DeletePermissionEndpoint: grpckit.NewClient(
conn, addr, "DeletePermission",
_Encode_DeletePermission_Request,
_Decode_DeletePermission_Response,
pb.DeletePermissionResponse{},
opts...,
).Endpoint(),
GetAccountEndpoint: grpckit.NewClient(
conn, addr, "GetAccount",
_Encode_GetAccount_Request,
_Decode_GetAccount_Response,
pb.GetAccountResponse{},
opts...,
).Endpoint(),
GetAllAccountsEndpoint: grpckit.NewClient(
conn, addr, "GetAllAccounts",
_Encode_GetAllAccounts_Request,
_Decode_GetAllAccounts_Response,
pb.GetAllAccountsResponse{},
opts...,
).Endpoint(),
GetAllPermissionEndpoint: grpckit.NewClient(
conn, addr, "GetAllPermission",
_Encode_GetAllPermission_Request,
_Decode_GetAllPermission_Response,
pb.GetAllPermissionResponse{},
opts...,
).Endpoint(),
GetAllServicesEndpoint: grpckit.NewClient(
conn, addr, "GetAllServices",
_Encode_GetAllServices_Request,
_Decode_GetAllServices_Response,
pb.GetAllServicesResponse{},
opts...,
).Endpoint(),
GetAllUsersEndpoint: grpckit.NewClient(
conn, addr, "GetAllUsers",
_Encode_GetAllUsers_Request,
_Decode_GetAllUsers_Response,
pb.GetAllUsersResponse{},
opts...,
).Endpoint(),
GetFilteredPermissionsEndpoint: grpckit.NewClient(
conn, addr, "GetFilteredPermissions",
_Encode_GetFilteredPermissions_Request,
_Decode_GetFilteredPermissions_Response,
pb.GetFilteredPermissionsResponse{},
opts...,
).Endpoint(),
GetPermissionEndpoint: grpckit.NewClient(
conn, addr, "GetPermission",
_Encode_GetPermission_Request,
_Decode_GetPermission_Response,
pb.GetPermissionResponse{},
opts...,
).Endpoint(),
GetServiceEndpoint: grpckit.NewClient(
conn, addr, "GetService",
_Encode_GetService_Request,
_Decode_GetService_Response,
pb.GetServiceResponse{},
opts...,
).Endpoint(),
GetUserEndpoint: grpckit.NewClient(
conn, addr, "GetUser",
_Encode_GetUser_Request,
_Decode_GetUser_Response,
pb.GetUserResponse{},
opts...,
).Endpoint(),
GetUserPermissionsEndpoint: grpckit.NewClient(
conn, addr, "GetUserPermissions",
_Encode_GetUserPermissions_Request,
_Decode_GetUserPermissions_Response,
pb.GetUserPermissionsResponse{},
opts...,
).Endpoint(),
RemoveAccountFromServiceEndpoint: grpckit.NewClient(
conn, addr, "RemoveAccountFromService",
_Encode_RemoveAccountFromService_Request,
_Decode_RemoveAccountFromService_Response,
pb.RemoveAccountFromServiceResponse{},
opts...,
).Endpoint(),
RemoveUserPermissionEndpoint: grpckit.NewClient(
conn, addr, "RemoveUserPermission",
_Encode_RemoveUserPermission_Request,
_Decode_RemoveUserPermission_Response,
pb.RemoveUserPermissionResponse{},
opts...,
).Endpoint(),
UnblockUserEndpoint: grpckit.NewClient(
conn, addr, "UnblockUser",
_Encode_UnblockUser_Request,
_Decode_UnblockUser_Response,
pb.UnblockUserResponse{},
opts...,
).Endpoint(),
UpdateAccountEndpoint: grpckit.NewClient(
conn, addr, "UpdateAccount",
_Encode_UpdateAccount_Request,
_Decode_UpdateAccount_Response,
pb.UpdateAccountResponse{},
opts...,
).Endpoint(),
UpdateUserEndpoint: grpckit.NewClient(
conn, addr, "UpdateUser",
_Encode_UpdateUser_Request,
_Decode_UpdateUser_Response,
pb.UpdateUserResponse{},
opts...,
).Endpoint(),
}
}