mirror of
https://github.com/p4gefau1t/trojan-go.git
synced 2024-04-21 12:21:34 +00:00
1227 lines
41 KiB
Go
1227 lines
41 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// versions:
|
|
// protoc-gen-go v1.23.0
|
|
// protoc v3.11.4
|
|
// source: api.proto
|
|
|
|
package api
|
|
|
|
import (
|
|
context "context"
|
|
proto "github.com/golang/protobuf/proto"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
reflect "reflect"
|
|
sync "sync"
|
|
)
|
|
|
|
const (
|
|
// Verify that this generated code is sufficiently up-to-date.
|
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
|
)
|
|
|
|
// This is a compile-time assertion that a sufficiently up-to-date version
|
|
// of the legacy proto package is being used.
|
|
const _ = proto.ProtoPackageIsVersion4
|
|
|
|
type SetUserRequest_Operation int32
|
|
|
|
const (
|
|
SetUserRequest_Add SetUserRequest_Operation = 0
|
|
SetUserRequest_Delete SetUserRequest_Operation = 1
|
|
SetUserRequest_Modify SetUserRequest_Operation = 2
|
|
)
|
|
|
|
// Enum value maps for SetUserRequest_Operation.
|
|
var (
|
|
SetUserRequest_Operation_name = map[int32]string{
|
|
0: "Add",
|
|
1: "Delete",
|
|
2: "Modify",
|
|
}
|
|
SetUserRequest_Operation_value = map[string]int32{
|
|
"Add": 0,
|
|
"Delete": 1,
|
|
"Modify": 2,
|
|
}
|
|
)
|
|
|
|
func (x SetUserRequest_Operation) Enum() *SetUserRequest_Operation {
|
|
p := new(SetUserRequest_Operation)
|
|
*p = x
|
|
return p
|
|
}
|
|
|
|
func (x SetUserRequest_Operation) String() string {
|
|
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
|
}
|
|
|
|
func (SetUserRequest_Operation) Descriptor() protoreflect.EnumDescriptor {
|
|
return file_api_proto_enumTypes[0].Descriptor()
|
|
}
|
|
|
|
func (SetUserRequest_Operation) Type() protoreflect.EnumType {
|
|
return &file_api_proto_enumTypes[0]
|
|
}
|
|
|
|
func (x SetUserRequest_Operation) Number() protoreflect.EnumNumber {
|
|
return protoreflect.EnumNumber(x)
|
|
}
|
|
|
|
// Deprecated: Use SetUserRequest_Operation.Descriptor instead.
|
|
func (SetUserRequest_Operation) EnumDescriptor() ([]byte, []int) {
|
|
return file_api_proto_rawDescGZIP(), []int{7, 0}
|
|
}
|
|
|
|
type Traffic struct {
|
|
state protoimpl.MessageState
|
|
sizeCache protoimpl.SizeCache
|
|
unknownFields protoimpl.UnknownFields
|
|
|
|
UploadTraffic uint64 `protobuf:"varint,1,opt,name=upload_traffic,json=uploadTraffic,proto3" json:"upload_traffic,omitempty"`
|
|
DownloadTraffic uint64 `protobuf:"varint,2,opt,name=download_traffic,json=downloadTraffic,proto3" json:"download_traffic,omitempty"`
|
|
}
|
|
|
|
func (x *Traffic) Reset() {
|
|
*x = Traffic{}
|
|
if protoimpl.UnsafeEnabled {
|
|
mi := &file_api_proto_msgTypes[0]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
}
|
|
|
|
func (x *Traffic) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*Traffic) ProtoMessage() {}
|
|
|
|
func (x *Traffic) ProtoReflect() protoreflect.Message {
|
|
mi := &file_api_proto_msgTypes[0]
|
|
if protoimpl.UnsafeEnabled && x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use Traffic.ProtoReflect.Descriptor instead.
|
|
func (*Traffic) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_rawDescGZIP(), []int{0}
|
|
}
|
|
|
|
func (x *Traffic) GetUploadTraffic() uint64 {
|
|
if x != nil {
|
|
return x.UploadTraffic
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *Traffic) GetDownloadTraffic() uint64 {
|
|
if x != nil {
|
|
return x.DownloadTraffic
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type Speed struct {
|
|
state protoimpl.MessageState
|
|
sizeCache protoimpl.SizeCache
|
|
unknownFields protoimpl.UnknownFields
|
|
|
|
UploadSpeed uint64 `protobuf:"varint,1,opt,name=upload_speed,json=uploadSpeed,proto3" json:"upload_speed,omitempty"`
|
|
DownloadSpeed uint64 `protobuf:"varint,2,opt,name=download_speed,json=downloadSpeed,proto3" json:"download_speed,omitempty"`
|
|
}
|
|
|
|
func (x *Speed) Reset() {
|
|
*x = Speed{}
|
|
if protoimpl.UnsafeEnabled {
|
|
mi := &file_api_proto_msgTypes[1]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
}
|
|
|
|
func (x *Speed) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*Speed) ProtoMessage() {}
|
|
|
|
func (x *Speed) ProtoReflect() protoreflect.Message {
|
|
mi := &file_api_proto_msgTypes[1]
|
|
if protoimpl.UnsafeEnabled && x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use Speed.ProtoReflect.Descriptor instead.
|
|
func (*Speed) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_rawDescGZIP(), []int{1}
|
|
}
|
|
|
|
func (x *Speed) GetUploadSpeed() uint64 {
|
|
if x != nil {
|
|
return x.UploadSpeed
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *Speed) GetDownloadSpeed() uint64 {
|
|
if x != nil {
|
|
return x.DownloadSpeed
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type User struct {
|
|
state protoimpl.MessageState
|
|
sizeCache protoimpl.SizeCache
|
|
unknownFields protoimpl.UnknownFields
|
|
|
|
Password string `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"`
|
|
Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
|
|
}
|
|
|
|
func (x *User) Reset() {
|
|
*x = User{}
|
|
if protoimpl.UnsafeEnabled {
|
|
mi := &file_api_proto_msgTypes[2]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
}
|
|
|
|
func (x *User) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*User) ProtoMessage() {}
|
|
|
|
func (x *User) ProtoReflect() protoreflect.Message {
|
|
mi := &file_api_proto_msgTypes[2]
|
|
if protoimpl.UnsafeEnabled && x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use User.ProtoReflect.Descriptor instead.
|
|
func (*User) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_rawDescGZIP(), []int{2}
|
|
}
|
|
|
|
func (x *User) GetPassword() string {
|
|
if x != nil {
|
|
return x.Password
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *User) GetHash() string {
|
|
if x != nil {
|
|
return x.Hash
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type GetTrafficRequest struct {
|
|
state protoimpl.MessageState
|
|
sizeCache protoimpl.SizeCache
|
|
unknownFields protoimpl.UnknownFields
|
|
|
|
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
|
|
}
|
|
|
|
func (x *GetTrafficRequest) Reset() {
|
|
*x = GetTrafficRequest{}
|
|
if protoimpl.UnsafeEnabled {
|
|
mi := &file_api_proto_msgTypes[3]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
}
|
|
|
|
func (x *GetTrafficRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*GetTrafficRequest) ProtoMessage() {}
|
|
|
|
func (x *GetTrafficRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_api_proto_msgTypes[3]
|
|
if protoimpl.UnsafeEnabled && x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use GetTrafficRequest.ProtoReflect.Descriptor instead.
|
|
func (*GetTrafficRequest) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_rawDescGZIP(), []int{3}
|
|
}
|
|
|
|
func (x *GetTrafficRequest) GetUser() *User {
|
|
if x != nil {
|
|
return x.User
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type GetTrafficResponse struct {
|
|
state protoimpl.MessageState
|
|
sizeCache protoimpl.SizeCache
|
|
unknownFields protoimpl.UnknownFields
|
|
|
|
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
|
|
TrafficTotal *Traffic `protobuf:"bytes,2,opt,name=traffic_total,json=trafficTotal,proto3" json:"traffic_total,omitempty"`
|
|
SpeedCurrent *Speed `protobuf:"bytes,3,opt,name=speed_current,json=speedCurrent,proto3" json:"speed_current,omitempty"`
|
|
SpeedLimit *Speed `protobuf:"bytes,4,opt,name=speed_limit,json=speedLimit,proto3" json:"speed_limit,omitempty"`
|
|
Info string `protobuf:"bytes,5,opt,name=info,proto3" json:"info,omitempty"`
|
|
}
|
|
|
|
func (x *GetTrafficResponse) Reset() {
|
|
*x = GetTrafficResponse{}
|
|
if protoimpl.UnsafeEnabled {
|
|
mi := &file_api_proto_msgTypes[4]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
}
|
|
|
|
func (x *GetTrafficResponse) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*GetTrafficResponse) ProtoMessage() {}
|
|
|
|
func (x *GetTrafficResponse) ProtoReflect() protoreflect.Message {
|
|
mi := &file_api_proto_msgTypes[4]
|
|
if protoimpl.UnsafeEnabled && x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use GetTrafficResponse.ProtoReflect.Descriptor instead.
|
|
func (*GetTrafficResponse) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_rawDescGZIP(), []int{4}
|
|
}
|
|
|
|
func (x *GetTrafficResponse) GetSuccess() bool {
|
|
if x != nil {
|
|
return x.Success
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (x *GetTrafficResponse) GetTrafficTotal() *Traffic {
|
|
if x != nil {
|
|
return x.TrafficTotal
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *GetTrafficResponse) GetSpeedCurrent() *Speed {
|
|
if x != nil {
|
|
return x.SpeedCurrent
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *GetTrafficResponse) GetSpeedLimit() *Speed {
|
|
if x != nil {
|
|
return x.SpeedLimit
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *GetTrafficResponse) GetInfo() string {
|
|
if x != nil {
|
|
return x.Info
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type ListUserRequest struct {
|
|
state protoimpl.MessageState
|
|
sizeCache protoimpl.SizeCache
|
|
unknownFields protoimpl.UnknownFields
|
|
}
|
|
|
|
func (x *ListUserRequest) Reset() {
|
|
*x = ListUserRequest{}
|
|
if protoimpl.UnsafeEnabled {
|
|
mi := &file_api_proto_msgTypes[5]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
}
|
|
|
|
func (x *ListUserRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*ListUserRequest) ProtoMessage() {}
|
|
|
|
func (x *ListUserRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_api_proto_msgTypes[5]
|
|
if protoimpl.UnsafeEnabled && x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use ListUserRequest.ProtoReflect.Descriptor instead.
|
|
func (*ListUserRequest) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_rawDescGZIP(), []int{5}
|
|
}
|
|
|
|
type ListUserResponse struct {
|
|
state protoimpl.MessageState
|
|
sizeCache protoimpl.SizeCache
|
|
unknownFields protoimpl.UnknownFields
|
|
|
|
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
|
|
Online bool `protobuf:"varint,2,opt,name=online,proto3" json:"online,omitempty"`
|
|
TrafficTotal *Traffic `protobuf:"bytes,3,opt,name=traffic_total,json=trafficTotal,proto3" json:"traffic_total,omitempty"`
|
|
SpeedCurrent *Speed `protobuf:"bytes,4,opt,name=speed_current,json=speedCurrent,proto3" json:"speed_current,omitempty"`
|
|
SpeedLimit *Speed `protobuf:"bytes,5,opt,name=speed_limit,json=speedLimit,proto3" json:"speed_limit,omitempty"`
|
|
IpLimit int32 `protobuf:"varint,6,opt,name=ip_limit,json=ipLimit,proto3" json:"ip_limit,omitempty"`
|
|
}
|
|
|
|
func (x *ListUserResponse) Reset() {
|
|
*x = ListUserResponse{}
|
|
if protoimpl.UnsafeEnabled {
|
|
mi := &file_api_proto_msgTypes[6]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
}
|
|
|
|
func (x *ListUserResponse) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*ListUserResponse) ProtoMessage() {}
|
|
|
|
func (x *ListUserResponse) ProtoReflect() protoreflect.Message {
|
|
mi := &file_api_proto_msgTypes[6]
|
|
if protoimpl.UnsafeEnabled && x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use ListUserResponse.ProtoReflect.Descriptor instead.
|
|
func (*ListUserResponse) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_rawDescGZIP(), []int{6}
|
|
}
|
|
|
|
func (x *ListUserResponse) GetUser() *User {
|
|
if x != nil {
|
|
return x.User
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *ListUserResponse) GetOnline() bool {
|
|
if x != nil {
|
|
return x.Online
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (x *ListUserResponse) GetTrafficTotal() *Traffic {
|
|
if x != nil {
|
|
return x.TrafficTotal
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *ListUserResponse) GetSpeedCurrent() *Speed {
|
|
if x != nil {
|
|
return x.SpeedCurrent
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *ListUserResponse) GetSpeedLimit() *Speed {
|
|
if x != nil {
|
|
return x.SpeedLimit
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *ListUserResponse) GetIpLimit() int32 {
|
|
if x != nil {
|
|
return x.IpLimit
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type SetUserRequest struct {
|
|
state protoimpl.MessageState
|
|
sizeCache protoimpl.SizeCache
|
|
unknownFields protoimpl.UnknownFields
|
|
|
|
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
|
|
Operation SetUserRequest_Operation `protobuf:"varint,2,opt,name=operation,proto3,enum=trojan.api.SetUserRequest_Operation" json:"operation,omitempty"`
|
|
SpeedLimit *Speed `protobuf:"bytes,3,opt,name=speed_limit,json=speedLimit,proto3" json:"speed_limit,omitempty"`
|
|
IpLimit int32 `protobuf:"varint,4,opt,name=ip_limit,json=ipLimit,proto3" json:"ip_limit,omitempty"`
|
|
}
|
|
|
|
func (x *SetUserRequest) Reset() {
|
|
*x = SetUserRequest{}
|
|
if protoimpl.UnsafeEnabled {
|
|
mi := &file_api_proto_msgTypes[7]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
}
|
|
|
|
func (x *SetUserRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*SetUserRequest) ProtoMessage() {}
|
|
|
|
func (x *SetUserRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_api_proto_msgTypes[7]
|
|
if protoimpl.UnsafeEnabled && x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use SetUserRequest.ProtoReflect.Descriptor instead.
|
|
func (*SetUserRequest) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_rawDescGZIP(), []int{7}
|
|
}
|
|
|
|
func (x *SetUserRequest) GetUser() *User {
|
|
if x != nil {
|
|
return x.User
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *SetUserRequest) GetOperation() SetUserRequest_Operation {
|
|
if x != nil {
|
|
return x.Operation
|
|
}
|
|
return SetUserRequest_Add
|
|
}
|
|
|
|
func (x *SetUserRequest) GetSpeedLimit() *Speed {
|
|
if x != nil {
|
|
return x.SpeedLimit
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *SetUserRequest) GetIpLimit() int32 {
|
|
if x != nil {
|
|
return x.IpLimit
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type SetUserResponse struct {
|
|
state protoimpl.MessageState
|
|
sizeCache protoimpl.SizeCache
|
|
unknownFields protoimpl.UnknownFields
|
|
|
|
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
|
|
Info string `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"`
|
|
}
|
|
|
|
func (x *SetUserResponse) Reset() {
|
|
*x = SetUserResponse{}
|
|
if protoimpl.UnsafeEnabled {
|
|
mi := &file_api_proto_msgTypes[8]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
}
|
|
|
|
func (x *SetUserResponse) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*SetUserResponse) ProtoMessage() {}
|
|
|
|
func (x *SetUserResponse) ProtoReflect() protoreflect.Message {
|
|
mi := &file_api_proto_msgTypes[8]
|
|
if protoimpl.UnsafeEnabled && x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use SetUserResponse.ProtoReflect.Descriptor instead.
|
|
func (*SetUserResponse) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_rawDescGZIP(), []int{8}
|
|
}
|
|
|
|
func (x *SetUserResponse) GetSuccess() bool {
|
|
if x != nil {
|
|
return x.Success
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (x *SetUserResponse) GetInfo() string {
|
|
if x != nil {
|
|
return x.Info
|
|
}
|
|
return ""
|
|
}
|
|
|
|
var File_api_proto protoreflect.FileDescriptor
|
|
|
|
var file_api_proto_rawDesc = []byte{
|
|
0x0a, 0x09, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x74, 0x72, 0x6f,
|
|
0x6a, 0x61, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x22, 0x5b, 0x0a, 0x07, 0x54, 0x72, 0x61, 0x66, 0x66,
|
|
0x69, 0x63, 0x12, 0x25, 0x0a, 0x0e, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x74, 0x72, 0x61,
|
|
0x66, 0x66, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x75, 0x70, 0x6c, 0x6f,
|
|
0x61, 0x64, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x12, 0x29, 0x0a, 0x10, 0x64, 0x6f, 0x77,
|
|
0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x74, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x18, 0x02, 0x20,
|
|
0x01, 0x28, 0x04, 0x52, 0x0f, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x72, 0x61,
|
|
0x66, 0x66, 0x69, 0x63, 0x22, 0x51, 0x0a, 0x05, 0x53, 0x70, 0x65, 0x65, 0x64, 0x12, 0x21, 0x0a,
|
|
0x0c, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x73, 0x70, 0x65, 0x65, 0x64, 0x18, 0x01, 0x20,
|
|
0x01, 0x28, 0x04, 0x52, 0x0b, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x70, 0x65, 0x65, 0x64,
|
|
0x12, 0x25, 0x0a, 0x0e, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x73, 0x70, 0x65,
|
|
0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f,
|
|
0x61, 0x64, 0x53, 0x70, 0x65, 0x65, 0x64, 0x22, 0x36, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12,
|
|
0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
|
|
0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x68,
|
|
0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x22,
|
|
0x39, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x52, 0x65, 0x71,
|
|
0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01,
|
|
0x28, 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e,
|
|
0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0xe8, 0x01, 0x0a, 0x12, 0x47,
|
|
0x65, 0x74, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
|
0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01,
|
|
0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x38, 0x0a, 0x0d, 0x74,
|
|
0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01,
|
|
0x28, 0x0b, 0x32, 0x13, 0x2e, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e,
|
|
0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63,
|
|
0x54, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x36, 0x0a, 0x0d, 0x73, 0x70, 0x65, 0x65, 0x64, 0x5f, 0x63,
|
|
0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74,
|
|
0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x70, 0x65, 0x65, 0x64, 0x52,
|
|
0x0c, 0x73, 0x70, 0x65, 0x65, 0x64, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x32, 0x0a,
|
|
0x0b, 0x73, 0x70, 0x65, 0x65, 0x64, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01,
|
|
0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e,
|
|
0x53, 0x70, 0x65, 0x65, 0x64, 0x52, 0x0a, 0x73, 0x70, 0x65, 0x65, 0x64, 0x4c, 0x69, 0x6d, 0x69,
|
|
0x74, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,
|
|
0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x11, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65,
|
|
0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x91, 0x02, 0x0a, 0x10, 0x4c, 0x69, 0x73,
|
|
0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a,
|
|
0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x72,
|
|
0x6f, 0x6a, 0x61, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75,
|
|
0x73, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20,
|
|
0x01, 0x28, 0x08, 0x52, 0x06, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x38, 0x0a, 0x0d, 0x74,
|
|
0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01,
|
|
0x28, 0x0b, 0x32, 0x13, 0x2e, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e,
|
|
0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63,
|
|
0x54, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x36, 0x0a, 0x0d, 0x73, 0x70, 0x65, 0x65, 0x64, 0x5f, 0x63,
|
|
0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74,
|
|
0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x70, 0x65, 0x65, 0x64, 0x52,
|
|
0x0c, 0x73, 0x70, 0x65, 0x65, 0x64, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x32, 0x0a,
|
|
0x0b, 0x73, 0x70, 0x65, 0x65, 0x64, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01,
|
|
0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e,
|
|
0x53, 0x70, 0x65, 0x65, 0x64, 0x52, 0x0a, 0x73, 0x70, 0x65, 0x65, 0x64, 0x4c, 0x69, 0x6d, 0x69,
|
|
0x74, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x70, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x06, 0x20,
|
|
0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x70, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0xf7, 0x01, 0x0a,
|
|
0x0e, 0x53, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
|
|
0x24, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e,
|
|
0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52,
|
|
0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69,
|
|
0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x74, 0x72, 0x6f, 0x6a, 0x61,
|
|
0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71,
|
|
0x75, 0x65, 0x73, 0x74, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09,
|
|
0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x0b, 0x73, 0x70, 0x65,
|
|
0x65, 0x64, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11,
|
|
0x2e, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x70, 0x65, 0x65,
|
|
0x64, 0x52, 0x0a, 0x73, 0x70, 0x65, 0x65, 0x64, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a,
|
|
0x08, 0x69, 0x70, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52,
|
|
0x07, 0x69, 0x70, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x2c, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72,
|
|
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x64, 0x64, 0x10, 0x00, 0x12, 0x0a,
|
|
0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x6f,
|
|
0x64, 0x69, 0x66, 0x79, 0x10, 0x02, 0x22, 0x3f, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x55, 0x73, 0x65,
|
|
0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63,
|
|
0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63,
|
|
0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28,
|
|
0x09, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x32, 0x64, 0x0a, 0x13, 0x54, 0x72, 0x6f, 0x6a, 0x61,
|
|
0x6e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4d,
|
|
0x0a, 0x0a, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x12, 0x1d, 0x2e, 0x74,
|
|
0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61,
|
|
0x66, 0x66, 0x69, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x74, 0x72,
|
|
0x6f, 0x6a, 0x61, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x66,
|
|
0x66, 0x69, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x32, 0xff, 0x01,
|
|
0x0a, 0x13, 0x54, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x65,
|
|
0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4a, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65,
|
|
0x72, 0x73, 0x12, 0x1b, 0x2e, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e,
|
|
0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
|
0x1c, 0x2e, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73,
|
|
0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30,
|
|
0x01, 0x12, 0x51, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x12,
|
|
0x1d, 0x2e, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74,
|
|
0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e,
|
|
0x2e, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x54,
|
|
0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
|
|
0x28, 0x01, 0x30, 0x01, 0x12, 0x49, 0x0a, 0x08, 0x53, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73,
|
|
0x12, 0x1a, 0x2e, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65,
|
|
0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x74,
|
|
0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x74, 0x55, 0x73, 0x65,
|
|
0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42,
|
|
0x07, 0x5a, 0x05, 0x2e, 0x3b, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
|
}
|
|
|
|
var (
|
|
file_api_proto_rawDescOnce sync.Once
|
|
file_api_proto_rawDescData = file_api_proto_rawDesc
|
|
)
|
|
|
|
func file_api_proto_rawDescGZIP() []byte {
|
|
file_api_proto_rawDescOnce.Do(func() {
|
|
file_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_proto_rawDescData)
|
|
})
|
|
return file_api_proto_rawDescData
|
|
}
|
|
|
|
var file_api_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
|
var file_api_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
|
|
var file_api_proto_goTypes = []interface{}{
|
|
(SetUserRequest_Operation)(0), // 0: trojan.api.SetUserRequest.Operation
|
|
(*Traffic)(nil), // 1: trojan.api.Traffic
|
|
(*Speed)(nil), // 2: trojan.api.Speed
|
|
(*User)(nil), // 3: trojan.api.User
|
|
(*GetTrafficRequest)(nil), // 4: trojan.api.GetTrafficRequest
|
|
(*GetTrafficResponse)(nil), // 5: trojan.api.GetTrafficResponse
|
|
(*ListUserRequest)(nil), // 6: trojan.api.ListUserRequest
|
|
(*ListUserResponse)(nil), // 7: trojan.api.ListUserResponse
|
|
(*SetUserRequest)(nil), // 8: trojan.api.SetUserRequest
|
|
(*SetUserResponse)(nil), // 9: trojan.api.SetUserResponse
|
|
}
|
|
var file_api_proto_depIdxs = []int32{
|
|
3, // 0: trojan.api.GetTrafficRequest.user:type_name -> trojan.api.User
|
|
1, // 1: trojan.api.GetTrafficResponse.traffic_total:type_name -> trojan.api.Traffic
|
|
2, // 2: trojan.api.GetTrafficResponse.speed_current:type_name -> trojan.api.Speed
|
|
2, // 3: trojan.api.GetTrafficResponse.speed_limit:type_name -> trojan.api.Speed
|
|
3, // 4: trojan.api.ListUserResponse.user:type_name -> trojan.api.User
|
|
1, // 5: trojan.api.ListUserResponse.traffic_total:type_name -> trojan.api.Traffic
|
|
2, // 6: trojan.api.ListUserResponse.speed_current:type_name -> trojan.api.Speed
|
|
2, // 7: trojan.api.ListUserResponse.speed_limit:type_name -> trojan.api.Speed
|
|
3, // 8: trojan.api.SetUserRequest.user:type_name -> trojan.api.User
|
|
0, // 9: trojan.api.SetUserRequest.operation:type_name -> trojan.api.SetUserRequest.Operation
|
|
2, // 10: trojan.api.SetUserRequest.speed_limit:type_name -> trojan.api.Speed
|
|
4, // 11: trojan.api.TrojanClientService.GetTraffic:input_type -> trojan.api.GetTrafficRequest
|
|
6, // 12: trojan.api.TrojanServerService.ListUsers:input_type -> trojan.api.ListUserRequest
|
|
4, // 13: trojan.api.TrojanServerService.GetTraffic:input_type -> trojan.api.GetTrafficRequest
|
|
8, // 14: trojan.api.TrojanServerService.SetUsers:input_type -> trojan.api.SetUserRequest
|
|
5, // 15: trojan.api.TrojanClientService.GetTraffic:output_type -> trojan.api.GetTrafficResponse
|
|
7, // 16: trojan.api.TrojanServerService.ListUsers:output_type -> trojan.api.ListUserResponse
|
|
5, // 17: trojan.api.TrojanServerService.GetTraffic:output_type -> trojan.api.GetTrafficResponse
|
|
9, // 18: trojan.api.TrojanServerService.SetUsers:output_type -> trojan.api.SetUserResponse
|
|
15, // [15:19] is the sub-list for method output_type
|
|
11, // [11:15] is the sub-list for method input_type
|
|
11, // [11:11] is the sub-list for extension type_name
|
|
11, // [11:11] is the sub-list for extension extendee
|
|
0, // [0:11] is the sub-list for field type_name
|
|
}
|
|
|
|
func init() { file_api_proto_init() }
|
|
func file_api_proto_init() {
|
|
if File_api_proto != nil {
|
|
return
|
|
}
|
|
if !protoimpl.UnsafeEnabled {
|
|
file_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
|
switch v := v.(*Traffic); i {
|
|
case 0:
|
|
return &v.state
|
|
case 1:
|
|
return &v.sizeCache
|
|
case 2:
|
|
return &v.unknownFields
|
|
default:
|
|
return nil
|
|
}
|
|
}
|
|
file_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
|
switch v := v.(*Speed); i {
|
|
case 0:
|
|
return &v.state
|
|
case 1:
|
|
return &v.sizeCache
|
|
case 2:
|
|
return &v.unknownFields
|
|
default:
|
|
return nil
|
|
}
|
|
}
|
|
file_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
|
switch v := v.(*User); i {
|
|
case 0:
|
|
return &v.state
|
|
case 1:
|
|
return &v.sizeCache
|
|
case 2:
|
|
return &v.unknownFields
|
|
default:
|
|
return nil
|
|
}
|
|
}
|
|
file_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
|
switch v := v.(*GetTrafficRequest); i {
|
|
case 0:
|
|
return &v.state
|
|
case 1:
|
|
return &v.sizeCache
|
|
case 2:
|
|
return &v.unknownFields
|
|
default:
|
|
return nil
|
|
}
|
|
}
|
|
file_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
|
switch v := v.(*GetTrafficResponse); i {
|
|
case 0:
|
|
return &v.state
|
|
case 1:
|
|
return &v.sizeCache
|
|
case 2:
|
|
return &v.unknownFields
|
|
default:
|
|
return nil
|
|
}
|
|
}
|
|
file_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
|
switch v := v.(*ListUserRequest); i {
|
|
case 0:
|
|
return &v.state
|
|
case 1:
|
|
return &v.sizeCache
|
|
case 2:
|
|
return &v.unknownFields
|
|
default:
|
|
return nil
|
|
}
|
|
}
|
|
file_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
|
switch v := v.(*ListUserResponse); i {
|
|
case 0:
|
|
return &v.state
|
|
case 1:
|
|
return &v.sizeCache
|
|
case 2:
|
|
return &v.unknownFields
|
|
default:
|
|
return nil
|
|
}
|
|
}
|
|
file_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
|
switch v := v.(*SetUserRequest); i {
|
|
case 0:
|
|
return &v.state
|
|
case 1:
|
|
return &v.sizeCache
|
|
case 2:
|
|
return &v.unknownFields
|
|
default:
|
|
return nil
|
|
}
|
|
}
|
|
file_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
|
|
switch v := v.(*SetUserResponse); i {
|
|
case 0:
|
|
return &v.state
|
|
case 1:
|
|
return &v.sizeCache
|
|
case 2:
|
|
return &v.unknownFields
|
|
default:
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
type x struct{}
|
|
out := protoimpl.TypeBuilder{
|
|
File: protoimpl.DescBuilder{
|
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
RawDescriptor: file_api_proto_rawDesc,
|
|
NumEnums: 1,
|
|
NumMessages: 9,
|
|
NumExtensions: 0,
|
|
NumServices: 2,
|
|
},
|
|
GoTypes: file_api_proto_goTypes,
|
|
DependencyIndexes: file_api_proto_depIdxs,
|
|
EnumInfos: file_api_proto_enumTypes,
|
|
MessageInfos: file_api_proto_msgTypes,
|
|
}.Build()
|
|
File_api_proto = out.File
|
|
file_api_proto_rawDesc = nil
|
|
file_api_proto_goTypes = nil
|
|
file_api_proto_depIdxs = nil
|
|
}
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ context.Context
|
|
var _ grpc.ClientConnInterface
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
const _ = grpc.SupportPackageIsVersion6
|
|
|
|
// TrojanClientServiceClient is the client API for TrojanClientService service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
type TrojanClientServiceClient interface {
|
|
GetTraffic(ctx context.Context, in *GetTrafficRequest, opts ...grpc.CallOption) (*GetTrafficResponse, error)
|
|
}
|
|
|
|
type trojanClientServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewTrojanClientServiceClient(cc grpc.ClientConnInterface) TrojanClientServiceClient {
|
|
return &trojanClientServiceClient{cc}
|
|
}
|
|
|
|
func (c *trojanClientServiceClient) GetTraffic(ctx context.Context, in *GetTrafficRequest, opts ...grpc.CallOption) (*GetTrafficResponse, error) {
|
|
out := new(GetTrafficResponse)
|
|
err := c.cc.Invoke(ctx, "/trojan.api.TrojanClientService/GetTraffic", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// TrojanClientServiceServer is the server API for TrojanClientService service.
|
|
type TrojanClientServiceServer interface {
|
|
GetTraffic(context.Context, *GetTrafficRequest) (*GetTrafficResponse, error)
|
|
}
|
|
|
|
// UnimplementedTrojanClientServiceServer can be embedded to have forward compatible implementations.
|
|
type UnimplementedTrojanClientServiceServer struct {
|
|
}
|
|
|
|
func (*UnimplementedTrojanClientServiceServer) GetTraffic(context.Context, *GetTrafficRequest) (*GetTrafficResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetTraffic not implemented")
|
|
}
|
|
|
|
func RegisterTrojanClientServiceServer(s *grpc.Server, srv TrojanClientServiceServer) {
|
|
s.RegisterService(&_TrojanClientService_serviceDesc, srv)
|
|
}
|
|
|
|
func _TrojanClientService_GetTraffic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetTrafficRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TrojanClientServiceServer).GetTraffic(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/trojan.api.TrojanClientService/GetTraffic",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TrojanClientServiceServer).GetTraffic(ctx, req.(*GetTrafficRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
var _TrojanClientService_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "trojan.api.TrojanClientService",
|
|
HandlerType: (*TrojanClientServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "GetTraffic",
|
|
Handler: _TrojanClientService_GetTraffic_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "api.proto",
|
|
}
|
|
|
|
// TrojanServerServiceClient is the client API for TrojanServerService service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
type TrojanServerServiceClient interface {
|
|
ListUsers(ctx context.Context, in *ListUserRequest, opts ...grpc.CallOption) (TrojanServerService_ListUsersClient, error)
|
|
GetTraffic(ctx context.Context, opts ...grpc.CallOption) (TrojanServerService_GetTrafficClient, error)
|
|
SetUsers(ctx context.Context, opts ...grpc.CallOption) (TrojanServerService_SetUsersClient, error)
|
|
}
|
|
|
|
type trojanServerServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewTrojanServerServiceClient(cc grpc.ClientConnInterface) TrojanServerServiceClient {
|
|
return &trojanServerServiceClient{cc}
|
|
}
|
|
|
|
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], "/trojan.api.TrojanServerService/ListUsers", opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &trojanServerServiceListUsersClient{stream}
|
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
|
return nil, err
|
|
}
|
|
return x, nil
|
|
}
|
|
|
|
type TrojanServerService_ListUsersClient interface {
|
|
Recv() (*ListUserResponse, error)
|
|
grpc.ClientStream
|
|
}
|
|
|
|
type trojanServerServiceListUsersClient struct {
|
|
grpc.ClientStream
|
|
}
|
|
|
|
func (x *trojanServerServiceListUsersClient) Recv() (*ListUserResponse, error) {
|
|
m := new(ListUserResponse)
|
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
func (c *trojanServerServiceClient) GetTraffic(ctx context.Context, opts ...grpc.CallOption) (TrojanServerService_GetTrafficClient, error) {
|
|
stream, err := c.cc.NewStream(ctx, &_TrojanServerService_serviceDesc.Streams[1], "/trojan.api.TrojanServerService/GetTraffic", opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &trojanServerServiceGetTrafficClient{stream}
|
|
return x, nil
|
|
}
|
|
|
|
type TrojanServerService_GetTrafficClient interface {
|
|
Send(*GetTrafficRequest) error
|
|
Recv() (*GetTrafficResponse, error)
|
|
grpc.ClientStream
|
|
}
|
|
|
|
type trojanServerServiceGetTrafficClient struct {
|
|
grpc.ClientStream
|
|
}
|
|
|
|
func (x *trojanServerServiceGetTrafficClient) Send(m *GetTrafficRequest) error {
|
|
return x.ClientStream.SendMsg(m)
|
|
}
|
|
|
|
func (x *trojanServerServiceGetTrafficClient) Recv() (*GetTrafficResponse, error) {
|
|
m := new(GetTrafficResponse)
|
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
func (c *trojanServerServiceClient) SetUsers(ctx context.Context, opts ...grpc.CallOption) (TrojanServerService_SetUsersClient, error) {
|
|
stream, err := c.cc.NewStream(ctx, &_TrojanServerService_serviceDesc.Streams[2], "/trojan.api.TrojanServerService/SetUsers", opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &trojanServerServiceSetUsersClient{stream}
|
|
return x, nil
|
|
}
|
|
|
|
type TrojanServerService_SetUsersClient interface {
|
|
Send(*SetUserRequest) error
|
|
Recv() (*SetUserResponse, error)
|
|
grpc.ClientStream
|
|
}
|
|
|
|
type trojanServerServiceSetUsersClient struct {
|
|
grpc.ClientStream
|
|
}
|
|
|
|
func (x *trojanServerServiceSetUsersClient) Send(m *SetUserRequest) error {
|
|
return x.ClientStream.SendMsg(m)
|
|
}
|
|
|
|
func (x *trojanServerServiceSetUsersClient) Recv() (*SetUserResponse, error) {
|
|
m := new(SetUserResponse)
|
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
// TrojanServerServiceServer is the server API for TrojanServerService service.
|
|
type TrojanServerServiceServer interface {
|
|
ListUsers(*ListUserRequest, TrojanServerService_ListUsersServer) error
|
|
GetTraffic(TrojanServerService_GetTrafficServer) error
|
|
SetUsers(TrojanServerService_SetUsersServer) error
|
|
}
|
|
|
|
// UnimplementedTrojanServerServiceServer can be embedded to have forward compatible implementations.
|
|
type UnimplementedTrojanServerServiceServer struct {
|
|
}
|
|
|
|
func (*UnimplementedTrojanServerServiceServer) ListUsers(*ListUserRequest, TrojanServerService_ListUsersServer) error {
|
|
return status.Errorf(codes.Unimplemented, "method ListUsers not implemented")
|
|
}
|
|
func (*UnimplementedTrojanServerServiceServer) GetTraffic(TrojanServerService_GetTrafficServer) error {
|
|
return status.Errorf(codes.Unimplemented, "method GetTraffic not implemented")
|
|
}
|
|
func (*UnimplementedTrojanServerServiceServer) SetUsers(TrojanServerService_SetUsersServer) error {
|
|
return status.Errorf(codes.Unimplemented, "method SetUsers not implemented")
|
|
}
|
|
|
|
func RegisterTrojanServerServiceServer(s *grpc.Server, srv TrojanServerServiceServer) {
|
|
s.RegisterService(&_TrojanServerService_serviceDesc, srv)
|
|
}
|
|
|
|
func _TrojanServerService_ListUsers_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(ListUserRequest)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(TrojanServerServiceServer).ListUsers(m, &trojanServerServiceListUsersServer{stream})
|
|
}
|
|
|
|
type TrojanServerService_ListUsersServer interface {
|
|
Send(*ListUserResponse) error
|
|
grpc.ServerStream
|
|
}
|
|
|
|
type trojanServerServiceListUsersServer struct {
|
|
grpc.ServerStream
|
|
}
|
|
|
|
func (x *trojanServerServiceListUsersServer) Send(m *ListUserResponse) error {
|
|
return x.ServerStream.SendMsg(m)
|
|
}
|
|
|
|
func _TrojanServerService_GetTraffic_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
return srv.(TrojanServerServiceServer).GetTraffic(&trojanServerServiceGetTrafficServer{stream})
|
|
}
|
|
|
|
type TrojanServerService_GetTrafficServer interface {
|
|
Send(*GetTrafficResponse) error
|
|
Recv() (*GetTrafficRequest, error)
|
|
grpc.ServerStream
|
|
}
|
|
|
|
type trojanServerServiceGetTrafficServer struct {
|
|
grpc.ServerStream
|
|
}
|
|
|
|
func (x *trojanServerServiceGetTrafficServer) Send(m *GetTrafficResponse) error {
|
|
return x.ServerStream.SendMsg(m)
|
|
}
|
|
|
|
func (x *trojanServerServiceGetTrafficServer) Recv() (*GetTrafficRequest, error) {
|
|
m := new(GetTrafficRequest)
|
|
if err := x.ServerStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
func _TrojanServerService_SetUsers_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
return srv.(TrojanServerServiceServer).SetUsers(&trojanServerServiceSetUsersServer{stream})
|
|
}
|
|
|
|
type TrojanServerService_SetUsersServer interface {
|
|
Send(*SetUserResponse) error
|
|
Recv() (*SetUserRequest, error)
|
|
grpc.ServerStream
|
|
}
|
|
|
|
type trojanServerServiceSetUsersServer struct {
|
|
grpc.ServerStream
|
|
}
|
|
|
|
func (x *trojanServerServiceSetUsersServer) Send(m *SetUserResponse) error {
|
|
return x.ServerStream.SendMsg(m)
|
|
}
|
|
|
|
func (x *trojanServerServiceSetUsersServer) Recv() (*SetUserRequest, error) {
|
|
m := new(SetUserRequest)
|
|
if err := x.ServerStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
var _TrojanServerService_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "trojan.api.TrojanServerService",
|
|
HandlerType: (*TrojanServerServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "ListUsers",
|
|
Handler: _TrojanServerService_ListUsers_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
{
|
|
StreamName: "GetTraffic",
|
|
Handler: _TrojanServerService_GetTraffic_Handler,
|
|
ServerStreams: true,
|
|
ClientStreams: true,
|
|
},
|
|
{
|
|
StreamName: "SetUsers",
|
|
Handler: _TrojanServerService_SetUsers_Handler,
|
|
ServerStreams: true,
|
|
ClientStreams: true,
|
|
},
|
|
},
|
|
Metadata: "api.proto",
|
|
}
|