stats

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Address.ProtoReflect.Descriptor instead.

func (*Address) GetAddr

func (x *Address) GetAddr() string

func (*Address) GetCity

func (x *Address) GetCity() string

func (*Address) GetCountry

func (x *Address) GetCountry() string

func (*Address) GetIsp

func (x *Address) GetIsp() string

func (*Address) GetLat

func (x *Address) GetLat() float64

func (*Address) GetLong

func (x *Address) GetLong() float64

func (*Address) GetPtr

func (x *Address) GetPtr() string

func (*Address) ProtoMessage

func (*Address) ProtoMessage()

func (*Address) ProtoReflect

func (x *Address) ProtoReflect() protoreflect.Message

func (*Address) Reset

func (x *Address) Reset()

func (*Address) String

func (x *Address) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Owner.ProtoReflect.Descriptor instead.

func (*Owner) GetEmail

func (x *Owner) GetEmail() string

func (*Owner) GetName

func (x *Owner) GetName() string

func (*Owner) ProtoMessage

func (*Owner) ProtoMessage()

func (*Owner) ProtoReflect

func (x *Owner) ProtoReflect() protoreflect.Message

func (*Owner) Reset

func (x *Owner) Reset()

func (*Owner) String

func (x *Owner) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Peer.ProtoReflect.Descriptor instead.

func (*Peer) GetAddr

func (x *Peer) GetAddr() *Address

func (*Peer) GetAddress

func (x *Peer) GetAddress() string

func (*Peer) GetAllowedIPs

func (x *Peer) GetAllowedIPs() string

func (*Peer) GetHandshake

func (x *Peer) GetHandshake() *timestamppb.Timestamp

func (*Peer) GetOwner

func (x *Peer) GetOwner() *Owner

func (*Peer) GetPublicKey

func (x *Peer) GetPublicKey() string

func (*Peer) GetReceived

func (x *Peer) GetReceived() string

func (*Peer) GetReceivedBytes

func (x *Peer) GetReceivedBytes() float64

func (*Peer) GetSent

func (x *Peer) GetSent() string

func (*Peer) GetSentBytes

func (x *Peer) GetSentBytes() float64

func (*Peer) ProtoMessage

func (*Peer) ProtoMessage()

func (*Peer) ProtoReflect

func (x *Peer) ProtoReflect() protoreflect.Message

func (*Peer) Reset

func (x *Peer) Reset()

func (*Peer) String

func (x *Peer) String() string

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL