Documentation ¶
Index ¶
- Variables
- func NewServer(logger log.Logger, options option.V2RayAPIOptions) (adapter.V2RayServer, error)
- func RegisterStatsServiceServer(s grpc.ServiceRegistrar, srv StatsServiceServer)
- type GetStatsRequest
- func (*GetStatsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetStatsRequest) GetName() string
- func (x *GetStatsRequest) GetReset_() bool
- func (*GetStatsRequest) ProtoMessage()
- func (x *GetStatsRequest) ProtoReflect() protoreflect.Message
- func (x *GetStatsRequest) Reset()
- func (x *GetStatsRequest) String() string
- type GetStatsResponse
- type QueryStatsRequest
- func (*QueryStatsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryStatsRequest) GetPattern() string
- func (x *QueryStatsRequest) GetPatterns() []string
- func (x *QueryStatsRequest) GetRegexp() bool
- func (x *QueryStatsRequest) GetReset_() bool
- func (*QueryStatsRequest) ProtoMessage()
- func (x *QueryStatsRequest) ProtoReflect() protoreflect.Message
- func (x *QueryStatsRequest) Reset()
- func (x *QueryStatsRequest) String() string
- type QueryStatsResponse
- func (*QueryStatsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *QueryStatsResponse) GetStat() []*Stat
- func (*QueryStatsResponse) ProtoMessage()
- func (x *QueryStatsResponse) ProtoReflect() protoreflect.Message
- func (x *QueryStatsResponse) Reset()
- func (x *QueryStatsResponse) String() string
- type Server
- type Stat
- type StatsService
- func (s *StatsService) GetStats(ctx context.Context, request *GetStatsRequest) (*GetStatsResponse, error)
- func (s *StatsService) GetSysStats(ctx context.Context, request *SysStatsRequest) (*SysStatsResponse, error)
- func (s *StatsService) QueryStats(ctx context.Context, request *QueryStatsRequest) (*QueryStatsResponse, error)
- func (s *StatsService) RoutedConnection(inbound string, outbound string, conn net.Conn) net.Conn
- func (s *StatsService) RoutedPacketConnection(inbound string, outbound string, conn N.PacketConn) N.PacketConn
- type StatsServiceClient
- type StatsServiceServer
- type SysStatsRequest
- type SysStatsResponse
- func (*SysStatsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SysStatsResponse) GetAlloc() uint64
- func (x *SysStatsResponse) GetFrees() uint64
- func (x *SysStatsResponse) GetLiveObjects() uint64
- func (x *SysStatsResponse) GetMallocs() uint64
- func (x *SysStatsResponse) GetNumGC() uint32
- func (x *SysStatsResponse) GetNumGoroutine() uint32
- func (x *SysStatsResponse) GetPauseTotalNs() uint64
- func (x *SysStatsResponse) GetSys() uint64
- func (x *SysStatsResponse) GetTotalAlloc() uint64
- func (x *SysStatsResponse) GetUptime() uint32
- func (*SysStatsResponse) ProtoMessage()
- func (x *SysStatsResponse) ProtoReflect() protoreflect.Message
- func (x *SysStatsResponse) Reset()
- func (x *SysStatsResponse) String() string
- type UnimplementedStatsServiceServer
- func (UnimplementedStatsServiceServer) GetStats(context.Context, *GetStatsRequest) (*GetStatsResponse, error)
- func (UnimplementedStatsServiceServer) GetSysStats(context.Context, *SysStatsRequest) (*SysStatsResponse, error)
- func (UnimplementedStatsServiceServer) QueryStats(context.Context, *QueryStatsRequest) (*QueryStatsResponse, error)
- type UnsafeStatsServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_experimental_v2rayapi_stats_proto protoreflect.FileDescriptor
var StatsService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "experimental.v2rayapi.StatsService", HandlerType: (*StatsServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetStats", Handler: _StatsService_GetStats_Handler, }, { MethodName: "QueryStats", Handler: _StatsService_QueryStats_Handler, }, { MethodName: "GetSysStats", Handler: _StatsService_GetSysStats_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "experimental/v2rayapi/stats.proto", }
StatsService_ServiceDesc is the grpc.ServiceDesc for StatsService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func NewServer ¶
func NewServer(logger log.Logger, options option.V2RayAPIOptions) (adapter.V2RayServer, error)
func RegisterStatsServiceServer ¶
func RegisterStatsServiceServer(s grpc.ServiceRegistrar, srv StatsServiceServer)
Types ¶
type GetStatsRequest ¶
type GetStatsRequest struct { // Name of the stat counter. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Whether or not to reset the counter to fetching its value. Reset_ bool `protobuf:"varint,2,opt,name=reset,proto3" json:"reset,omitempty"` // contains filtered or unexported fields }
func (*GetStatsRequest) Descriptor
deprecated
func (*GetStatsRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetStatsRequest.ProtoReflect.Descriptor instead.
func (*GetStatsRequest) GetName ¶
func (x *GetStatsRequest) GetName() string
func (*GetStatsRequest) GetReset_ ¶
func (x *GetStatsRequest) GetReset_() bool
func (*GetStatsRequest) ProtoMessage ¶
func (*GetStatsRequest) ProtoMessage()
func (*GetStatsRequest) ProtoReflect ¶
func (x *GetStatsRequest) ProtoReflect() protoreflect.Message
func (*GetStatsRequest) Reset ¶
func (x *GetStatsRequest) Reset()
func (*GetStatsRequest) String ¶
func (x *GetStatsRequest) String() string
type GetStatsResponse ¶
type GetStatsResponse struct { Stat *Stat `protobuf:"bytes,1,opt,name=stat,proto3" json:"stat,omitempty"` // contains filtered or unexported fields }
func (*GetStatsResponse) Descriptor
deprecated
func (*GetStatsResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetStatsResponse.ProtoReflect.Descriptor instead.
func (*GetStatsResponse) GetStat ¶
func (x *GetStatsResponse) GetStat() *Stat
func (*GetStatsResponse) ProtoMessage ¶
func (*GetStatsResponse) ProtoMessage()
func (*GetStatsResponse) ProtoReflect ¶
func (x *GetStatsResponse) ProtoReflect() protoreflect.Message
func (*GetStatsResponse) Reset ¶
func (x *GetStatsResponse) Reset()
func (*GetStatsResponse) String ¶
func (x *GetStatsResponse) String() string
type QueryStatsRequest ¶
type QueryStatsRequest struct { // Deprecated, use Patterns instead Pattern string `protobuf:"bytes,1,opt,name=pattern,proto3" json:"pattern,omitempty"` Reset_ bool `protobuf:"varint,2,opt,name=reset,proto3" json:"reset,omitempty"` Patterns []string `protobuf:"bytes,3,rep,name=patterns,proto3" json:"patterns,omitempty"` Regexp bool `protobuf:"varint,4,opt,name=regexp,proto3" json:"regexp,omitempty"` // contains filtered or unexported fields }
func (*QueryStatsRequest) Descriptor
deprecated
func (*QueryStatsRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryStatsRequest.ProtoReflect.Descriptor instead.
func (*QueryStatsRequest) GetPattern ¶
func (x *QueryStatsRequest) GetPattern() string
func (*QueryStatsRequest) GetPatterns ¶
func (x *QueryStatsRequest) GetPatterns() []string
func (*QueryStatsRequest) GetRegexp ¶
func (x *QueryStatsRequest) GetRegexp() bool
func (*QueryStatsRequest) GetReset_ ¶
func (x *QueryStatsRequest) GetReset_() bool
func (*QueryStatsRequest) ProtoMessage ¶
func (*QueryStatsRequest) ProtoMessage()
func (*QueryStatsRequest) ProtoReflect ¶
func (x *QueryStatsRequest) ProtoReflect() protoreflect.Message
func (*QueryStatsRequest) Reset ¶
func (x *QueryStatsRequest) Reset()
func (*QueryStatsRequest) String ¶
func (x *QueryStatsRequest) String() string
type QueryStatsResponse ¶
type QueryStatsResponse struct { Stat []*Stat `protobuf:"bytes,1,rep,name=stat,proto3" json:"stat,omitempty"` // contains filtered or unexported fields }
func (*QueryStatsResponse) Descriptor
deprecated
func (*QueryStatsResponse) Descriptor() ([]byte, []int)
Deprecated: Use QueryStatsResponse.ProtoReflect.Descriptor instead.
func (*QueryStatsResponse) GetStat ¶
func (x *QueryStatsResponse) GetStat() []*Stat
func (*QueryStatsResponse) ProtoMessage ¶
func (*QueryStatsResponse) ProtoMessage()
func (*QueryStatsResponse) ProtoReflect ¶
func (x *QueryStatsResponse) ProtoReflect() protoreflect.Message
func (*QueryStatsResponse) Reset ¶
func (x *QueryStatsResponse) Reset()
func (*QueryStatsResponse) String ¶
func (x *QueryStatsResponse) String() string
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) StatsService ¶
func (s *Server) StatsService() adapter.V2RayStatsService
type Stat ¶
type Stat struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*Stat) Descriptor
deprecated
func (*Stat) ProtoMessage ¶
func (*Stat) ProtoMessage()
func (*Stat) ProtoReflect ¶
func (x *Stat) ProtoReflect() protoreflect.Message
type StatsService ¶
type StatsService struct {
// contains filtered or unexported fields
}
func NewStatsService ¶
func NewStatsService(options option.V2RayStatsServiceOptions) *StatsService
func (*StatsService) GetStats ¶
func (s *StatsService) GetStats(ctx context.Context, request *GetStatsRequest) (*GetStatsResponse, error)
func (*StatsService) GetSysStats ¶
func (s *StatsService) GetSysStats(ctx context.Context, request *SysStatsRequest) (*SysStatsResponse, error)
func (*StatsService) QueryStats ¶
func (s *StatsService) QueryStats(ctx context.Context, request *QueryStatsRequest) (*QueryStatsResponse, error)
func (*StatsService) RoutedConnection ¶
func (*StatsService) RoutedPacketConnection ¶
func (s *StatsService) RoutedPacketConnection(inbound string, outbound string, conn N.PacketConn) N.PacketConn
type StatsServiceClient ¶
type StatsServiceClient interface { GetStats(ctx context.Context, in *GetStatsRequest, opts ...grpc.CallOption) (*GetStatsResponse, error) QueryStats(ctx context.Context, in *QueryStatsRequest, opts ...grpc.CallOption) (*QueryStatsResponse, error) GetSysStats(ctx context.Context, in *SysStatsRequest, opts ...grpc.CallOption) (*SysStatsResponse, error) }
StatsServiceClient is the client API for StatsService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewStatsServiceClient ¶
func NewStatsServiceClient(cc grpc.ClientConnInterface) StatsServiceClient
type StatsServiceServer ¶
type StatsServiceServer interface { GetStats(context.Context, *GetStatsRequest) (*GetStatsResponse, error) QueryStats(context.Context, *QueryStatsRequest) (*QueryStatsResponse, error) GetSysStats(context.Context, *SysStatsRequest) (*SysStatsResponse, error) // contains filtered or unexported methods }
StatsServiceServer is the server API for StatsService service. All implementations must embed UnimplementedStatsServiceServer for forward compatibility
type SysStatsRequest ¶
type SysStatsRequest struct {
// contains filtered or unexported fields
}
func (*SysStatsRequest) Descriptor
deprecated
func (*SysStatsRequest) Descriptor() ([]byte, []int)
Deprecated: Use SysStatsRequest.ProtoReflect.Descriptor instead.
func (*SysStatsRequest) ProtoMessage ¶
func (*SysStatsRequest) ProtoMessage()
func (*SysStatsRequest) ProtoReflect ¶
func (x *SysStatsRequest) ProtoReflect() protoreflect.Message
func (*SysStatsRequest) Reset ¶
func (x *SysStatsRequest) Reset()
func (*SysStatsRequest) String ¶
func (x *SysStatsRequest) String() string
type SysStatsResponse ¶
type SysStatsResponse struct { NumGoroutine uint32 `protobuf:"varint,1,opt,name=NumGoroutine,proto3" json:"NumGoroutine,omitempty"` NumGC uint32 `protobuf:"varint,2,opt,name=NumGC,proto3" json:"NumGC,omitempty"` Alloc uint64 `protobuf:"varint,3,opt,name=Alloc,proto3" json:"Alloc,omitempty"` TotalAlloc uint64 `protobuf:"varint,4,opt,name=TotalAlloc,proto3" json:"TotalAlloc,omitempty"` Sys uint64 `protobuf:"varint,5,opt,name=Sys,proto3" json:"Sys,omitempty"` Mallocs uint64 `protobuf:"varint,6,opt,name=Mallocs,proto3" json:"Mallocs,omitempty"` Frees uint64 `protobuf:"varint,7,opt,name=Frees,proto3" json:"Frees,omitempty"` LiveObjects uint64 `protobuf:"varint,8,opt,name=LiveObjects,proto3" json:"LiveObjects,omitempty"` PauseTotalNs uint64 `protobuf:"varint,9,opt,name=PauseTotalNs,proto3" json:"PauseTotalNs,omitempty"` Uptime uint32 `protobuf:"varint,10,opt,name=Uptime,proto3" json:"Uptime,omitempty"` // contains filtered or unexported fields }
func (*SysStatsResponse) Descriptor
deprecated
func (*SysStatsResponse) Descriptor() ([]byte, []int)
Deprecated: Use SysStatsResponse.ProtoReflect.Descriptor instead.
func (*SysStatsResponse) GetAlloc ¶
func (x *SysStatsResponse) GetAlloc() uint64
func (*SysStatsResponse) GetFrees ¶
func (x *SysStatsResponse) GetFrees() uint64
func (*SysStatsResponse) GetLiveObjects ¶
func (x *SysStatsResponse) GetLiveObjects() uint64
func (*SysStatsResponse) GetMallocs ¶
func (x *SysStatsResponse) GetMallocs() uint64
func (*SysStatsResponse) GetNumGC ¶
func (x *SysStatsResponse) GetNumGC() uint32
func (*SysStatsResponse) GetNumGoroutine ¶
func (x *SysStatsResponse) GetNumGoroutine() uint32
func (*SysStatsResponse) GetPauseTotalNs ¶
func (x *SysStatsResponse) GetPauseTotalNs() uint64
func (*SysStatsResponse) GetSys ¶
func (x *SysStatsResponse) GetSys() uint64
func (*SysStatsResponse) GetTotalAlloc ¶
func (x *SysStatsResponse) GetTotalAlloc() uint64
func (*SysStatsResponse) GetUptime ¶
func (x *SysStatsResponse) GetUptime() uint32
func (*SysStatsResponse) ProtoMessage ¶
func (*SysStatsResponse) ProtoMessage()
func (*SysStatsResponse) ProtoReflect ¶
func (x *SysStatsResponse) ProtoReflect() protoreflect.Message
func (*SysStatsResponse) Reset ¶
func (x *SysStatsResponse) Reset()
func (*SysStatsResponse) String ¶
func (x *SysStatsResponse) String() string
type UnimplementedStatsServiceServer ¶
type UnimplementedStatsServiceServer struct{}
UnimplementedStatsServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedStatsServiceServer) GetStats ¶
func (UnimplementedStatsServiceServer) GetStats(context.Context, *GetStatsRequest) (*GetStatsResponse, error)
func (UnimplementedStatsServiceServer) GetSysStats ¶
func (UnimplementedStatsServiceServer) GetSysStats(context.Context, *SysStatsRequest) (*SysStatsResponse, error)
func (UnimplementedStatsServiceServer) QueryStats ¶
func (UnimplementedStatsServiceServer) QueryStats(context.Context, *QueryStatsRequest) (*QueryStatsResponse, error)
type UnsafeStatsServiceServer ¶
type UnsafeStatsServiceServer interface {
// contains filtered or unexported methods
}
UnsafeStatsServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to StatsServiceServer will result in compilation errors.