Documentation ¶
Index ¶
- Variables
- func RegisterStatsServer(s grpc.ServiceRegistrar, srv StatsServer)
- type Address
- func (*Address) Descriptor() ([]byte, []int)deprecated
- func (x *Address) GetAddr() string
- func (x *Address) GetCity() string
- func (x *Address) GetCountry() string
- func (x *Address) GetIsp() string
- func (x *Address) GetLat() float64
- func (x *Address) GetLong() float64
- func (x *Address) GetPtr() string
- func (*Address) ProtoMessage()
- func (x *Address) ProtoReflect() protoreflect.Message
- func (x *Address) Reset()
- func (x *Address) String() string
- type Owner
- type Peer
- func (*Peer) Descriptor() ([]byte, []int)deprecated
- func (x *Peer) GetAddr() *Address
- func (x *Peer) GetAddress() string
- func (x *Peer) GetAllowedIPs() string
- func (x *Peer) GetHandshake() *timestamppb.Timestamp
- func (x *Peer) GetOwner() *Owner
- func (x *Peer) GetPublicKey() string
- func (x *Peer) GetReceived() string
- func (x *Peer) GetReceivedBytes() float64
- func (x *Peer) GetSent() string
- func (x *Peer) GetSentBytes() float64
- func (*Peer) ProtoMessage()
- func (x *Peer) ProtoReflect() protoreflect.Message
- func (x *Peer) Reset()
- func (x *Peer) String() string
- type Statistics
- func (*Statistics) Descriptor() ([]byte, []int)deprecated
- func (x *Statistics) GetAddress() string
- func (x *Statistics) GetDatetime() *timestamppb.Timestamp
- func (x *Statistics) GetLat() float64
- func (x *Statistics) GetLong() float64
- func (x *Statistics) GetPeer() []*Peer
- func (x *Statistics) GetPublicKey() string
- func (x *Statistics) GetReceived() string
- func (x *Statistics) GetReceivedBytes() float64
- func (x *Statistics) GetSent() string
- func (x *Statistics) GetSentBytes() float64
- func (*Statistics) ProtoMessage()
- func (x *Statistics) ProtoReflect() protoreflect.Message
- func (x *Statistics) Reset()
- func (x *Statistics) String() string
- type StatsClient
- type StatsServer
- type UnimplementedStatsServer
- type UnsafeStatsServer
Constants ¶
This section is empty.
Variables ¶
var File_wg_proto protoreflect.FileDescriptor
var Stats_ServiceDesc = grpc.ServiceDesc{ ServiceName: "Stats", HandlerType: (*StatsServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Get", Handler: _Stats_Get_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "wg.proto", }
Stats_ServiceDesc is the grpc.ServiceDesc for Stats service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterStatsServer ¶
func RegisterStatsServer(s grpc.ServiceRegistrar, srv StatsServer)
Types ¶
type Address ¶
type Address struct { Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"` Ptr string `protobuf:"bytes,2,opt,name=ptr,proto3" json:"ptr,omitempty"` Long float64 `protobuf:"fixed64,3,opt,name=long,proto3" json:"long,omitempty"` Lat float64 `protobuf:"fixed64,4,opt,name=lat,proto3" json:"lat,omitempty"` City string `protobuf:"bytes,5,opt,name=city,proto3" json:"city,omitempty"` Country string `protobuf:"bytes,6,opt,name=country,proto3" json:"country,omitempty"` Isp string `protobuf:"bytes,7,opt,name=isp,proto3" json:"isp,omitempty"` // contains filtered or unexported fields }
func (*Address) Descriptor
deprecated
func (*Address) GetCountry ¶
func (*Address) ProtoMessage ¶
func (*Address) ProtoMessage()
func (*Address) ProtoReflect ¶
func (x *Address) ProtoReflect() protoreflect.Message
type Owner ¶
type Owner struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` // contains filtered or unexported fields }
func (*Owner) Descriptor
deprecated
func (*Owner) ProtoMessage ¶
func (*Owner) ProtoMessage()
func (*Owner) ProtoReflect ¶
func (x *Owner) ProtoReflect() protoreflect.Message
type Peer ¶
type Peer struct { PublicKey string `protobuf:"bytes,1,opt,name=publicKey,proto3" json:"publicKey,omitempty"` Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` AllowedIPs string `protobuf:"bytes,3,opt,name=allowedIPs,proto3" json:"allowedIPs,omitempty"` Handshake *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=handshake,proto3" json:"handshake,omitempty"` SentBytes float64 `protobuf:"fixed64,5,opt,name=sent_bytes,json=sentBytes,proto3" json:"sent_bytes,omitempty"` ReceivedBytes float64 `protobuf:"fixed64,6,opt,name=received_bytes,json=receivedBytes,proto3" json:"received_bytes,omitempty"` // The following are human readable figures Sent string `protobuf:"bytes,7,opt,name=sent,proto3" json:"sent,omitempty"` Received string `protobuf:"bytes,8,opt,name=received,proto3" json:"received,omitempty"` // The following are enhanced versions of the above // and set when the service is explicitly set to // form them Owner *Owner `protobuf:"bytes,9,opt,name=owner,proto3" json:"owner,omitempty"` Addr *Address `protobuf:"bytes,10,opt,name=addr,proto3" json:"addr,omitempty"` // contains filtered or unexported fields }
Peer represents an individual peer connection.
Some fields may be missing, depending on how the wg-sock-stats daemon is configured (the default is optimised for security and speed)
func (*Peer) Descriptor
deprecated
func (*Peer) GetAddress ¶
func (*Peer) GetAllowedIPs ¶
func (*Peer) GetHandshake ¶
func (x *Peer) GetHandshake() *timestamppb.Timestamp
func (*Peer) GetPublicKey ¶
func (*Peer) GetReceived ¶
func (*Peer) GetReceivedBytes ¶
func (*Peer) GetSentBytes ¶
func (*Peer) ProtoMessage ¶
func (*Peer) ProtoMessage()
func (*Peer) ProtoReflect ¶
func (x *Peer) ProtoReflect() protoreflect.Message
type Statistics ¶
type Statistics struct { Datetime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=datetime,proto3" json:"datetime,omitempty"` Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` PublicKey string `protobuf:"bytes,3,opt,name=publicKey,proto3" json:"publicKey,omitempty"` SentBytes float64 `protobuf:"fixed64,4,opt,name=sent_bytes,json=sentBytes,proto3" json:"sent_bytes,omitempty"` ReceivedBytes float64 `protobuf:"fixed64,5,opt,name=received_bytes,json=receivedBytes,proto3" json:"received_bytes,omitempty"` // The following are human readable figures Sent string `protobuf:"bytes,6,opt,name=sent,proto3" json:"sent,omitempty"` Received string `protobuf:"bytes,7,opt,name=received,proto3" json:"received,omitempty"` Peer []*Peer `protobuf:"bytes,8,rep,name=peer,proto3" json:"peer,omitempty"` // The following are useful for pinpointing the // location of this server Long float64 `protobuf:"fixed64,9,opt,name=long,proto3" json:"long,omitempty"` Lat float64 `protobuf:"fixed64,10,opt,name=lat,proto3" json:"lat,omitempty"` // contains filtered or unexported fields }
Statistics returns a snapshot of current stats for the local server.
The data is accurate at the time it's generated by wireguard, and so may be totally wrong by the time it's parsed by the caller /shrug
func (*Statistics) Descriptor
deprecated
func (*Statistics) Descriptor() ([]byte, []int)
Deprecated: Use Statistics.ProtoReflect.Descriptor instead.
func (*Statistics) GetAddress ¶
func (x *Statistics) GetAddress() string
func (*Statistics) GetDatetime ¶
func (x *Statistics) GetDatetime() *timestamppb.Timestamp
func (*Statistics) GetLat ¶
func (x *Statistics) GetLat() float64
func (*Statistics) GetLong ¶
func (x *Statistics) GetLong() float64
func (*Statistics) GetPeer ¶
func (x *Statistics) GetPeer() []*Peer
func (*Statistics) GetPublicKey ¶
func (x *Statistics) GetPublicKey() string
func (*Statistics) GetReceived ¶
func (x *Statistics) GetReceived() string
func (*Statistics) GetReceivedBytes ¶
func (x *Statistics) GetReceivedBytes() float64
func (*Statistics) GetSent ¶
func (x *Statistics) GetSent() string
func (*Statistics) GetSentBytes ¶
func (x *Statistics) GetSentBytes() float64
func (*Statistics) ProtoMessage ¶
func (*Statistics) ProtoMessage()
func (*Statistics) ProtoReflect ¶
func (x *Statistics) ProtoReflect() protoreflect.Message
func (*Statistics) Reset ¶
func (x *Statistics) Reset()
func (*Statistics) String ¶
func (x *Statistics) String() string
type StatsClient ¶
type StatsClient interface {
Get(ctx context.Context, in *Statistics, opts ...grpc.CallOption) (*Statistics, error)
}
StatsClient is the client API for Stats 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 NewStatsClient ¶
func NewStatsClient(cc grpc.ClientConnInterface) StatsClient
type StatsServer ¶
type StatsServer interface { Get(context.Context, *Statistics) (*Statistics, error) // contains filtered or unexported methods }
StatsServer is the server API for Stats service. All implementations must embed UnimplementedStatsServer for forward compatibility
type UnimplementedStatsServer ¶
type UnimplementedStatsServer struct { }
UnimplementedStatsServer must be embedded to have forward compatible implementations.
func (UnimplementedStatsServer) Get ¶
func (UnimplementedStatsServer) Get(context.Context, *Statistics) (*Statistics, error)
type UnsafeStatsServer ¶
type UnsafeStatsServer interface {
// contains filtered or unexported methods
}
UnsafeStatsServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to StatsServer will result in compilation errors.