mirror of
https://github.com/p4gefau1t/trojan-go.git
synced 2024-04-21 12:21:34 +00:00
update api package name
This commit is contained in:
+54
-53
@@ -408,7 +408,7 @@ func (m *ListUserResponse) GetSpeedLimit() *Speed {
|
||||
type SetUserRequest struct {
|
||||
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
|
||||
SpeedLimit *Speed `protobuf:"bytes,2,opt,name=speed_limit,json=speedLimit,proto3" json:"speed_limit,omitempty"`
|
||||
Operation SetUserRequest_Operation `protobuf:"varint,3,opt,name=operation,proto3,enum=api.SetUserRequest_Operation" json:"operation,omitempty"`
|
||||
Operation SetUserRequest_Operation `protobuf:"varint,3,opt,name=operation,proto3,enum=trojan.api.SetUserRequest_Operation" json:"operation,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
@@ -508,16 +508,16 @@ func (m *SetUserResponse) GetInfo() string {
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterEnum("api.SetUserRequest_Operation", SetUserRequest_Operation_name, SetUserRequest_Operation_value)
|
||||
proto.RegisterType((*Traffic)(nil), "api.Traffic")
|
||||
proto.RegisterType((*Speed)(nil), "api.Speed")
|
||||
proto.RegisterType((*User)(nil), "api.User")
|
||||
proto.RegisterType((*GetTrafficRequest)(nil), "api.GetTrafficRequest")
|
||||
proto.RegisterType((*GetTrafficResponse)(nil), "api.GetTrafficResponse")
|
||||
proto.RegisterType((*ListUserRequest)(nil), "api.ListUserRequest")
|
||||
proto.RegisterType((*ListUserResponse)(nil), "api.ListUserResponse")
|
||||
proto.RegisterType((*SetUserRequest)(nil), "api.SetUserRequest")
|
||||
proto.RegisterType((*SetUserResponse)(nil), "api.SetUserResponse")
|
||||
proto.RegisterEnum("trojan.api.SetUserRequest_Operation", SetUserRequest_Operation_name, SetUserRequest_Operation_value)
|
||||
proto.RegisterType((*Traffic)(nil), "trojan.api.Traffic")
|
||||
proto.RegisterType((*Speed)(nil), "trojan.api.Speed")
|
||||
proto.RegisterType((*User)(nil), "trojan.api.User")
|
||||
proto.RegisterType((*GetTrafficRequest)(nil), "trojan.api.GetTrafficRequest")
|
||||
proto.RegisterType((*GetTrafficResponse)(nil), "trojan.api.GetTrafficResponse")
|
||||
proto.RegisterType((*ListUserRequest)(nil), "trojan.api.ListUserRequest")
|
||||
proto.RegisterType((*ListUserResponse)(nil), "trojan.api.ListUserResponse")
|
||||
proto.RegisterType((*SetUserRequest)(nil), "trojan.api.SetUserRequest")
|
||||
proto.RegisterType((*SetUserResponse)(nil), "trojan.api.SetUserResponse")
|
||||
}
|
||||
|
||||
func init() {
|
||||
@@ -525,41 +525,42 @@ func init() {
|
||||
}
|
||||
|
||||
var fileDescriptor_00212fb1f9d3bf1c = []byte{
|
||||
// 543 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xa4, 0x94, 0x5d, 0x6b, 0x13, 0x41,
|
||||
0x14, 0x86, 0xbb, 0xc9, 0xe6, 0x63, 0x4f, 0x3e, 0x7b, 0x5a, 0x6b, 0x08, 0x14, 0x74, 0x40, 0xa8,
|
||||
0x28, 0x51, 0x57, 0xf0, 0xa6, 0x42, 0x91, 0x08, 0xde, 0x54, 0xc4, 0x4d, 0xf4, 0xc6, 0x8b, 0xb0,
|
||||
0x66, 0x27, 0x74, 0x64, 0xdd, 0x59, 0x77, 0x26, 0x16, 0x7f, 0xa1, 0x3f, 0x40, 0xbc, 0xf1, 0xd7,
|
||||
0x98, 0x3d, 0xb3, 0x93, 0x4f, 0x49, 0x29, 0xde, 0xcd, 0xbc, 0xf3, 0x9e, 0x67, 0xcf, 0x79, 0x67,
|
||||
0x12, 0xf0, 0xc2, 0x54, 0x0c, 0xd2, 0x4c, 0x6a, 0x89, 0xe5, 0xc5, 0x92, 0x7d, 0x82, 0xda, 0x38,
|
||||
0x0b, 0x67, 0x33, 0x31, 0xc5, 0x07, 0xd0, 0x9e, 0xa7, 0xb1, 0x0c, 0xa3, 0x89, 0x36, 0x4a, 0xcf,
|
||||
0xb9, 0xe7, 0x9c, 0xb9, 0x41, 0xcb, 0xa8, 0xd6, 0xf6, 0x10, 0xba, 0x91, 0xbc, 0x4e, 0x36, 0x8c,
|
||||
0x25, 0x32, 0x76, 0xac, 0x5e, 0x58, 0xd9, 0x7b, 0xa8, 0x8c, 0x52, 0xce, 0x23, 0xbc, 0x0f, 0xcd,
|
||||
0x02, 0xad, 0xf2, 0x7d, 0x01, 0x6e, 0x18, 0xcd, 0x58, 0x16, 0x5f, 0x5f, 0x62, 0x8d, 0xc9, 0x40,
|
||||
0x5b, 0x56, 0x25, 0x1b, 0x7b, 0x01, 0xee, 0x07, 0xc5, 0x33, 0xec, 0x43, 0x3d, 0x0d, 0x95, 0xba,
|
||||
0x96, 0x99, 0xa1, 0x79, 0xc1, 0x72, 0x8f, 0x08, 0xee, 0x55, 0xa8, 0xae, 0x08, 0xe0, 0x05, 0xb4,
|
||||
0x66, 0x3e, 0x1c, 0xbe, 0xe1, 0xba, 0x68, 0x2c, 0xe0, 0xdf, 0xe6, 0x5c, 0x69, 0x3c, 0x05, 0x77,
|
||||
0xbe, 0x80, 0x11, 0xa0, 0xe1, 0x7b, 0x83, 0x3c, 0x9b, 0x9c, 0x1e, 0x90, 0xcc, 0x7e, 0x39, 0x80,
|
||||
0xeb, 0x45, 0x2a, 0x95, 0x89, 0xe2, 0xd8, 0x83, 0x9a, 0x9a, 0x4f, 0xa7, 0x5c, 0x29, 0x2a, 0xac,
|
||||
0x07, 0x76, 0x8b, 0xcf, 0xa0, 0x55, 0x24, 0x32, 0xd1, 0x52, 0x87, 0x31, 0x75, 0xd0, 0xf0, 0x9b,
|
||||
0x04, 0xb6, 0x98, 0x66, 0x61, 0x19, 0xe7, 0x0e, 0x7c, 0x02, 0x2d, 0x9a, 0x76, 0x32, 0x9d, 0x67,
|
||||
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18, 0x8b,
|
||||
0x45, 0x8e, 0x23, 0x9e, 0x7d, 0x17, 0x53, 0x8e, 0x17, 0x00, 0xab, 0x67, 0x8e, 0x27, 0xd4, 0xfd,
|
||||
0xce, 0x8f, 0xa5, 0x7f, 0x77, 0x47, 0x37, 0x3d, 0xb0, 0x03, 0xff, 0xb7, 0x63, 0xc1, 0x39, 0x92,
|
||||
0x67, 0x16, 0xfc, 0x12, 0x3c, 0xfb, 0xac, 0x14, 0x1e, 0x53, 0xfd, 0xd6, 0xd3, 0xeb, 0xdf, 0xd9,
|
||||
0x52, 0x2d, 0xf3, 0xa9, 0x83, 0xc3, 0xff, 0x6c, 0xeb, 0xcc, 0x59, 0x40, 0xce, 0xa1, 0x5e, 0x64,
|
||||
0xa6, 0xf0, 0xe8, 0x1f, 0xf7, 0xd2, 0x3f, 0xde, 0x14, 0xd7, 0x8b, 0x3f, 0x57, 0xe9, 0x8f, 0xf2,
|
||||
0xf9, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x39, 0xcf, 0x4f, 0x4f, 0x35, 0x05, 0x00, 0x00,
|
||||
// 560 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x54, 0x4d, 0x6f, 0xd3, 0x40,
|
||||
0x10, 0xad, 0x13, 0xa7, 0x89, 0x27, 0x5f, 0xce, 0x54, 0x42, 0x51, 0x0a, 0x08, 0x56, 0x45, 0x2a,
|
||||
0x12, 0x8a, 0x90, 0x91, 0x2a, 0x38, 0x21, 0x5a, 0x24, 0x04, 0x6a, 0x85, 0xea, 0x84, 0x0b, 0x1c,
|
||||
0x22, 0x13, 0x6f, 0xd4, 0x45, 0xc6, 0x6b, 0xbc, 0x1b, 0x2a, 0xfe, 0x2b, 0x3f, 0x80, 0x5f, 0xc0,
|
||||
0x15, 0xec, 0x5d, 0x6f, 0xec, 0xb4, 0x8d, 0x88, 0x2a, 0x6e, 0xbb, 0x33, 0xef, 0xbd, 0x99, 0x79,
|
||||
0x9e, 0x35, 0x38, 0x41, 0xc2, 0xc6, 0x49, 0xca, 0x25, 0x47, 0x90, 0x29, 0xff, 0x12, 0xc4, 0xe3,
|
||||
0x2c, 0x42, 0x3e, 0x41, 0x73, 0x9a, 0x06, 0x8b, 0x05, 0x9b, 0xe3, 0x23, 0xe8, 0x2d, 0x93, 0x88,
|
||||
0x07, 0xe1, 0x4c, 0xea, 0xc8, 0xd0, 0x7a, 0x60, 0x1d, 0xda, 0x7e, 0x57, 0x47, 0x0d, 0xec, 0x31,
|
||||
0xb8, 0x21, 0xbf, 0x8c, 0xd7, 0x80, 0x35, 0x05, 0xec, 0x9b, 0x78, 0x01, 0x25, 0xe7, 0xd0, 0x98,
|
||||
0x24, 0x94, 0x86, 0xf8, 0x10, 0x3a, 0x85, 0xb4, 0xc8, 0xef, 0x85, 0x70, 0x5b, 0xc7, 0x34, 0x24,
|
||||
0xab, 0xbe, 0x92, 0xd5, 0x20, 0x2d, 0xda, 0x35, 0x51, 0x05, 0x23, 0x47, 0x60, 0x7f, 0x10, 0x34,
|
||||
0xc5, 0x11, 0xb4, 0x92, 0x40, 0x88, 0x4b, 0x9e, 0x6a, 0x35, 0xc7, 0x5f, 0xdd, 0x11, 0xc1, 0xbe,
|
||||
0x08, 0xc4, 0x85, 0x12, 0x70, 0x7c, 0x75, 0x26, 0x2f, 0x60, 0xf0, 0x86, 0xca, 0xa2, 0x31, 0x9f,
|
||||
0x7e, 0x5b, 0x52, 0x21, 0xf1, 0x00, 0xec, 0x65, 0x26, 0xa6, 0x04, 0xda, 0x9e, 0x3b, 0x2e, 0x7d,
|
||||
0x19, 0xe7, 0x45, 0x7c, 0x95, 0x25, 0xbf, 0x2c, 0xc0, 0x2a, 0x57, 0x24, 0x3c, 0x16, 0x14, 0x87,
|
||||
0xd0, 0x14, 0xcb, 0xf9, 0x9c, 0x0a, 0xa1, 0xf8, 0x2d, 0xdf, 0x5c, 0xf1,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0xd7, 0xca, 0xcf, 0x67, 0x3c, 0x64,
|
||||
0x8b, 0x1f, 0x6e, 0x8d, 0xbc, 0x84, 0xfe, 0x4a, 0xf4, 0x9f, 0x1b, 0x6d, 0x76, 0xa5, 0x56, 0xee,
|
||||
0x8a, 0x17, 0xc2, 0xde, 0x54, 0x35, 0x78, 0x12, 0xb1, 0xcc, 0xe3, 0x09, 0x4d, 0xbf, 0xb3, 0x39,
|
||||
0xc5, 0x33, 0x80, 0xf2, 0xb1, 0xe0, 0xbd, 0xea, 0x10, 0xd7, 0x1e, 0xe0, 0xe8, 0xfe, 0xa6, 0xb4,
|
||||
0xee, 0x88, 0xec, 0x78, 0x7f, 0x2c, 0x53, 0x26, 0x2f, 0x40, 0x53, 0x53, 0xe6, 0x1d, 0x38, 0x66,
|
||||
0x2b, 0x05, 0xee, 0x57, 0x65, 0xae, 0x2c, 0xf0, 0xe8, 0xee, 0xcd, 0x49, 0x53, 0xe1, 0xa9, 0x85,
|
||||
0xe7, 0xff, 0xb5, 0xe5, 0x43, 0x2b, 0x93, 0x7c, 0x0b, 0xad, 0xc2, 0x5d, 0x81, 0xa3, 0xcd, 0x1f,
|
||||
0x72, 0xb4, 0x7f, 0x63, 0xae, 0x2a, 0x75, 0xdc, 0xf8, 0x58, 0xcf, 0x92, 0x9f, 0x77, 0xd5, 0xbf,
|
||||
0xfb, 0xd9, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb8, 0x88, 0x78, 0x44, 0xc8, 0x05, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@@ -587,7 +588,7 @@ func NewTrojanClientServiceClient(cc grpc.ClientConnInterface) TrojanClientServi
|
||||
|
||||
func (c *trojanClientServiceClient) GetTraffic(ctx context.Context, in *GetTrafficRequest, opts ...grpc.CallOption) (*GetTrafficResponse, error) {
|
||||
out := new(GetTrafficResponse)
|
||||
err := c.cc.Invoke(ctx, "/api.TrojanClientService/GetTraffic", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, "/trojan.api.TrojanClientService/GetTraffic", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -621,7 +622,7 @@ func _TrojanClientService_GetTraffic_Handler(srv interface{}, ctx context.Contex
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.TrojanClientService/GetTraffic",
|
||||
FullMethod: "/trojan.api.TrojanClientService/GetTraffic",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TrojanClientServiceServer).GetTraffic(ctx, req.(*GetTrafficRequest))
|
||||
@@ -630,7 +631,7 @@ func _TrojanClientService_GetTraffic_Handler(srv interface{}, ctx context.Contex
|
||||
}
|
||||
|
||||
var _TrojanClientService_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "api.TrojanClientService",
|
||||
ServiceName: "trojan.api.TrojanClientService",
|
||||
HandlerType: (*TrojanClientServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
@@ -660,7 +661,7 @@ func NewTrojanServerServiceClient(cc grpc.ClientConnInterface) TrojanServerServi
|
||||
}
|
||||
|
||||
func (c *trojanServerServiceClient) ListUsers(ctx context.Context, in *ListUserRequest, opts ...grpc.CallOption) (TrojanServerService_ListUsersClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &_TrojanServerService_serviceDesc.Streams[0], "/api.TrojanServerService/ListUsers", opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &_TrojanServerService_serviceDesc.Streams[0], "/trojan.api.TrojanServerService/ListUsers", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -692,7 +693,7 @@ func (x *trojanServerServiceListUsersClient) Recv() (*ListUserResponse, error) {
|
||||
}
|
||||
|
||||
func (c *trojanServerServiceClient) GetTraffic(ctx context.Context, opts ...grpc.CallOption) (TrojanServerService_GetTrafficClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &_TrojanServerService_serviceDesc.Streams[1], "/api.TrojanServerService/GetTraffic", opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &_TrojanServerService_serviceDesc.Streams[1], "/trojan.api.TrojanServerService/GetTraffic", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -723,7 +724,7 @@ func (x *trojanServerServiceGetTrafficClient) Recv() (*GetTrafficResponse, error
|
||||
}
|
||||
|
||||
func (c *trojanServerServiceClient) SetUsers(ctx context.Context, opts ...grpc.CallOption) (TrojanServerService_SetUsersClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &_TrojanServerService_serviceDesc.Streams[2], "/api.TrojanServerService/SetUsers", opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &_TrojanServerService_serviceDesc.Streams[2], "/trojan.api.TrojanServerService/SetUsers", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -852,7 +853,7 @@ func (x *trojanServerServiceSetUsersServer) Recv() (*SetUserRequest, error) {
|
||||
}
|
||||
|
||||
var _TrojanServerService_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "api.TrojanServerService",
|
||||
ServiceName: "trojan.api.TrojanServerService",
|
||||
HandlerType: (*TrojanServerServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{},
|
||||
Streams: []grpc.StreamDesc{
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
syntax = "proto3";
|
||||
package api;
|
||||
package trojan.api;
|
||||
option go_package = "api";
|
||||
|
||||
message Traffic {
|
||||
uint64 upload_traffic = 1;
|
||||
|
||||
Executable
+1
@@ -0,0 +1 @@
|
||||
protoc ./api.proto --go_out=plugins=grpc:.
|
||||
Reference in New Issue
Block a user