Add reporting and recording

This commit is contained in:
Kyle Carberry 2024-04-02 19:25:05 +00:00
parent e7517f00e1
commit d281e4a996
10 changed files with 765 additions and 142 deletions

View File

@ -0,0 +1,35 @@
package main
import (
"fmt"
"io"
"github.com/hashicorp/yamux"
"github.com/coder/coder/v2/codersdk/drpc"
"github.com/coder/coder/v2/inteld/proto"
)
func main() {
fmt.Printf("Hello!\n")
// drpc.MultiplexedConn()
}
func run() error {
// Multiplexes the incoming connection using yamux.
// This allows multiple function calls to occur over
// the same connection.
config := yamux.DefaultConfig()
config.LogOutput = io.Discard
session, err := yamux.Client(nil, config)
if err != nil {
return err
}
proto.NewDRPCIntelClientClient(drpc.MultiplexedConn(session))
return nil
}

View File

@ -1,7 +0,0 @@
package main
import "fmt"
func main() {
fmt.Printf("Hey\n")
}

2
go.mod
View File

@ -228,9 +228,11 @@ require (
github.com/alecthomas/chroma/v2 v2.13.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 // indirect
github.com/go-jose/go-jose/v4 v4.0.1 // indirect
github.com/kalafut/imohash v1.0.3 // indirect
github.com/mitchellh/hashstructure v1.1.0 // indirect
github.com/pion/transport/v2 v2.0.0 // indirect
github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739 // indirect
github.com/twmb/murmur3 v1.1.5 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
)

4
go.sum
View File

@ -595,6 +595,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/justinas/nosurf v1.1.1 h1:92Aw44hjSK4MxJeMSyDa7jwuI9GR2J/JCQiaKvXXSlk=
github.com/justinas/nosurf v1.1.1/go.mod h1:ALpWdSbuNGy2lZWtyXdjkYv4edL23oSEgfBT1gPJ5BQ=
github.com/kalafut/imohash v1.0.3 h1:p9c61km8+6ZMqKRnERwdoxp/CztrdLNEbpsyGgf+A4M=
github.com/kalafut/imohash v1.0.3/go.mod h1:6cn9lU0Sj8M4eu9UaQm1kR/5y3k/ayB68yntRhGloL4=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
github.com/kirsle/configdir v0.0.0-20170128060238-e45d2f54772f h1:dKccXx7xA56UNqOcFIbuqFjAWPVtP688j5QMgmo6OHU=
@ -885,6 +887,8 @@ github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0=
github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw=
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
github.com/twmb/murmur3 v1.1.5 h1:i9OLS9fkuLzBXjt6dptlAEyk58fJsSTXbRg3SgVyqgk=
github.com/twmb/murmur3 v1.1.5/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ=
github.com/u-root/gobusybox/src v0.0.0-20240225013946-a274a8d5d83a h1:eg5FkNoQp76ZsswyGZ+TjYqA/rhKefxK8BW7XOlQsxo=
github.com/u-root/gobusybox/src v0.0.0-20240225013946-a274a8d5d83a/go.mod h1:e/8TmrdreH0sZOw2DFKBaUV7bvDWRq6SeM9PzkuVM68=
github.com/u-root/u-root v0.14.0 h1:Ka4T10EEML7dQ5XDvO9c3MBN8z4nuSnGjcd1jmU2ivg=

View File

@ -3,6 +3,7 @@ package inteld
import (
"context"
"errors"
"fmt"
"net/http"
"os"
"os/exec"
@ -12,6 +13,7 @@ import (
"sync"
"time"
"github.com/ammario/tlru"
"github.com/elastic/go-sysinfo"
"github.com/hashicorp/yamux"
"github.com/spf13/afero"
@ -22,6 +24,8 @@ import (
"github.com/coder/coder/v2/inteld/pathman"
"github.com/coder/coder/v2/inteld/proto"
"github.com/coder/retry"
"github.com/kalafut/imohash"
)
type Dialer func(ctx context.Context) (proto.DRPCIntelDaemonClient, error)
@ -40,11 +44,25 @@ type Options struct {
// to and overridden in the $PATH so they can be man-in-the-middled.
InvokeDirectory string
// InvocationFlushInterval is the interval at which invocations
// are flushed to the server.
InvocationFlushInterval time.Duration
Logger slog.Logger
}
func New(opts Options) *API {
if opts.Dialer == nil {
panic("Dialer is required")
}
if opts.InvocationFlushInterval == 0 {
opts.InvocationFlushInterval = 5 * time.Second
}
if opts.Filesystem == nil {
opts.Filesystem = afero.NewOsFs()
}
closeContext, closeCancel := context.WithCancel(context.Background())
invocationQueue := newInvocationQueue(opts.InvocationFlushInterval)
api := &API{
clientDialer: opts.Dialer,
clientChan: make(chan proto.DRPCIntelDaemonClient),
@ -54,17 +72,21 @@ func New(opts Options) *API {
logger: opts.Logger,
invokeDirectory: opts.InvokeDirectory,
invokeBinary: opts.InvokeBinary,
invocationQueue: invocationQueue,
}
api.closeWaitGroup.Add(2)
api.closeWaitGroup.Add(3)
go api.invocationQueueLoop()
go api.connectLoop()
go api.registerLoop()
return api
}
// API serves an instance of the intel daemon.
type API struct {
filesystem afero.Fs
invokeBinary string
invokeDirectory string
invocationQueue *invocationQueue
clientDialer Dialer
clientChan chan proto.DRPCIntelDaemonClient
@ -76,6 +98,33 @@ type API struct {
logger slog.Logger
}
// invocationQueueLoop ensures that invocations are sent to the server
// at a regular interval.
func (a *API) invocationQueueLoop() {
defer a.logger.Debug(a.closeContext, "invocation queue loop exited")
defer a.closeWaitGroup.Done()
for {
err := a.invocationQueue.startSendLoop(a.closeContext, func(i []*proto.Invocation) error {
client, ok := a.client()
if !ok {
return xerrors.New("no client available")
}
_, err := client.RecordInvocation(a.closeContext, &proto.RecordInvocationRequest{
Invocations: i,
})
return err
})
if err != nil {
if errors.Is(err, context.Canceled) ||
errors.Is(err, yamux.ErrSessionShutdown) {
return
}
a.logger.Warn(a.closeContext, "unable to receive a message", slog.Error(err))
}
}
}
// registerLoop starts a loop that registers the system with the server.
func (a *API) registerLoop() {
defer a.logger.Debug(a.closeContext, "system loop exited")
defer a.closeWaitGroup.Done()
@ -98,7 +147,6 @@ func (a *API) registerLoop() {
a.logger.Warn(a.closeContext, "unable to fetch user.name from git config", slog.Error(err))
}
var (
machineID string
hostname string
osVersion string
memoryTotal uint64
@ -106,7 +154,6 @@ func (a *API) registerLoop() {
sysInfoHost, err := sysinfo.Host()
if err == nil {
info := sysInfoHost.Info()
machineID = info.UniqueID
osVersion = info.OS.Version
hostname = info.Hostname
mem, err := sysInfoHost.Memory()
@ -117,7 +164,6 @@ func (a *API) registerLoop() {
a.logger.Warn(a.closeContext, "unable to fetch machine information", slog.Error(err))
}
system, err := client.Register(a.closeContext, &proto.RegisterRequest{
MachineId: machineID,
Hostname: hostname,
OperatingSystem: runtime.GOOS,
Architecture: runtime.GOARCH,
@ -127,6 +173,9 @@ func (a *API) registerLoop() {
MemoryTotal: memoryTotal,
GitConfigEmail: userEmail,
GitConfigName: userName,
InstalledSoftware: &proto.InstalledSoftware{
// TODO: Make this valid!
},
})
if err != nil {
if errors.Is(err, context.Canceled) ||
@ -134,11 +183,11 @@ func (a *API) registerLoop() {
continue
}
}
a.systemLoop(system)
a.systemRecvLoop(system)
}
}
func (a *API) systemLoop(client proto.DRPCIntelDaemon_RegisterClient) {
func (a *API) systemRecvLoop(client proto.DRPCIntelDaemon_RegisterClient) {
ctx := a.closeContext
for {
resp, err := client.Recv()
@ -295,3 +344,149 @@ func fetchFromGitConfig(property string) (string, error) {
}
return strings.TrimSpace(string(output)), nil
}
var _ proto.DRPCIntelClientServer = (*API)(nil)
// ReportInvocation is called by the client to report an invocation.
func (a *API) ReportInvocation(_ context.Context, req *proto.ReportInvocationRequest) (*proto.Empty, error) {
a.invocationQueue.enqueue(req)
return &proto.Empty{}, nil
}
func newInvocationQueue(flushInterval time.Duration) *invocationQueue {
return &invocationQueue{
Cond: sync.NewCond(&sync.Mutex{}),
flushInterval: flushInterval,
binaryCache: tlru.New[string, *proto.Executable](tlru.ConstantCost, 1000),
gitRemoteCache: tlru.New[string, string](tlru.ConstantCost, 1000),
}
}
type invocationQueue struct {
*sync.Cond
flushInterval time.Duration
queue []*proto.Invocation
flushRequested bool
lastFlush time.Time
binaryCache *tlru.Cache[string, *proto.Executable]
gitRemoteCache *tlru.Cache[string, string]
logger slog.Logger
}
func (i *invocationQueue) enqueue(req *proto.ReportInvocationRequest) {
inv := &proto.Invocation{
Arguments: req.Arguments,
StartedAt: req.StartedAt,
FinishedAt: req.FinishedAt,
ExitCode: req.ExitCode,
WorkingDirectory: req.WorkingDirectory,
}
var err error
// We check if this is non-empty purely for testing. It's
// expected in production that this is always set.
if req.ExecutablePath != "" {
inv.Executable, err = i.binaryCache.Do(req.ExecutablePath, func() (*proto.Executable, error) {
rawHash, err := imohash.SumFile(req.ExecutablePath)
if err != nil {
return nil, err
}
hash := fmt.Sprintf("%X", rawHash)
return &proto.Executable{
Hash: hash,
Basename: filepath.Base(req.ExecutablePath),
Path: req.ExecutablePath,
}, nil
}, 24*time.Hour)
if err != nil {
i.logger.Error(context.Background(), "failed to inspect executable", slog.Error(err))
return
}
}
// We check if this is non-empty purely for testing. It's
// expected in production that this is always set.
if req.WorkingDirectory != "" {
inv.GitRemoteUrl, err = i.gitRemoteCache.Do(req.WorkingDirectory, func() (string, error) {
cmd := exec.Command("git", "remote", "get-url", "origin")
cmd.Dir = req.WorkingDirectory
out, err := cmd.Output()
if err != nil {
return "", err
}
return strings.TrimSpace(string(out)), nil
}, time.Hour)
if err != nil {
// This isn't worth failing the execution on, but is an issue
// that is worth reporting!
i.logger.Error(context.Background(), "failed to inspect git remote", slog.Error(err))
}
}
i.L.Lock()
defer i.L.Unlock()
i.queue = append(i.queue, inv)
i.Broadcast()
}
func (i *invocationQueue) startSendLoop(ctx context.Context, flush func([]*proto.Invocation) error) error {
i.L.Lock()
defer i.L.Unlock()
ctxDone := false
// wake 4 times per Flush interval to check if anything needs to be flushed
ctx, cancel := context.WithCancel(ctx)
defer cancel()
go func() {
tkr := time.NewTicker(i.flushInterval / 4)
defer tkr.Stop()
for {
select {
// also monitor the context here, so we notice immediately, rather
// than waiting for the next tick or logs
case <-ctx.Done():
i.L.Lock()
ctxDone = true
i.L.Unlock()
i.Broadcast()
return
case <-tkr.C:
i.Broadcast()
}
}
}()
for {
for !ctxDone && !i.hasPendingWorkLocked() {
i.Wait()
}
if ctxDone {
return ctx.Err()
}
queue := i.queue[:]
i.flushRequested = false
i.L.Unlock()
err := flush(queue)
i.L.Lock()
if err != nil {
return xerrors.Errorf("failed to flush invocations: %w", err)
}
i.queue = i.queue[len(queue):]
i.lastFlush = time.Now()
}
}
func (i *invocationQueue) hasPendingWorkLocked() bool {
if len(i.queue) == 0 {
return false
}
if time.Since(i.lastFlush) > i.flushInterval {
return true
}
if i.flushRequested {
return true
}
return false
}

View File

@ -0,0 +1,45 @@
package inteld
import (
"context"
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/coder/coder/v2/inteld/proto"
)
func Test_invocationQueue(t *testing.T) {
t.Parallel()
t.Run("EnqueueWhileSending", func(t *testing.T) {
// This test ensures that no invocations are missed while
// a group of invocations are being sent.
t.Parallel()
ctx, cancelFunc := context.WithCancel(context.Background())
queue := newInvocationQueue(time.Millisecond)
sendStarted := make(chan []*proto.Invocation)
sendCompleted := make(chan struct{})
go queue.startSendLoop(ctx, func(i []*proto.Invocation) error {
sendStarted <- i
<-sendCompleted
return nil
})
queue.enqueue(&proto.ReportInvocationRequest{
ExitCode: 1,
})
inv := <-sendStarted
require.Len(t, inv, 1)
require.Equal(t, int32(1), inv[0].ExitCode)
queue.enqueue(&proto.ReportInvocationRequest{
ExitCode: 2,
})
sendCompleted <- struct{}{}
inv = <-sendStarted
require.Len(t, inv, 1)
require.Equal(t, int32(2), inv[0].ExitCode)
sendCompleted <- struct{}{}
cancelFunc()
})
}

View File

@ -33,15 +33,16 @@ func TestInteld(t *testing.T) {
t.Run("InstantlyRegisters", func(t *testing.T) {
t.Parallel()
done := make(chan struct{})
registered := make(chan struct{})
t.Cleanup(func() {
close(done)
})
registered := make(chan struct{})
daemon := inteld.New(inteld.Options{
Dialer: func(ctx context.Context) (proto.DRPCIntelDaemonClient, error) {
return createIntelDaemonClient(t, done, inteldServer{
register: func(req *proto.RegisterRequest, _ proto.DRPCIntelDaemon_RegisterStream) error {
close(registered)
register: func(_ *proto.RegisterRequest, stream proto.DRPCIntelDaemon_RegisterStream) error {
registered <- struct{}{}
<-ctx.Done()
return nil
},
}), nil
@ -58,7 +59,7 @@ func TestInteld(t *testing.T) {
type inteldServer struct {
register func(req *proto.RegisterRequest, stream proto.DRPCIntelDaemon_RegisterStream) error
recordInvocation func(context.Context, *proto.ReportInvocationRequest) (*proto.Empty, error)
recordInvocation func(context.Context, *proto.RecordInvocationRequest) (*proto.Empty, error)
reportPath func(context.Context, *proto.ReportPathRequest) (*proto.Empty, error)
}
@ -69,7 +70,7 @@ func (i *inteldServer) Register(req *proto.RegisterRequest, stream proto.DRPCInt
return i.register(req, stream)
}
func (i *inteldServer) RecordInvocation(ctx context.Context, inv *proto.ReportInvocationRequest) (*proto.Empty, error) {
func (i *inteldServer) RecordInvocation(ctx context.Context, inv *proto.RecordInvocationRequest) (*proto.Empty, error) {
if i.recordInvocation == nil {
return &proto.Empty{}, nil
}

View File

@ -274,7 +274,7 @@ func (x *ReportPathRequest) GetExecutables() []*Executable {
return nil
}
type ReportInvocationRequest struct {
type RecordInvocationRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@ -282,8 +282,8 @@ type ReportInvocationRequest struct {
Invocations []*Invocation `protobuf:"bytes,1,rep,name=invocations,proto3" json:"invocations,omitempty"`
}
func (x *ReportInvocationRequest) Reset() {
*x = ReportInvocationRequest{}
func (x *RecordInvocationRequest) Reset() {
*x = RecordInvocationRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_inteld_proto_inteld_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -291,13 +291,13 @@ func (x *ReportInvocationRequest) Reset() {
}
}
func (x *ReportInvocationRequest) String() string {
func (x *RecordInvocationRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ReportInvocationRequest) ProtoMessage() {}
func (*RecordInvocationRequest) ProtoMessage() {}
func (x *ReportInvocationRequest) ProtoReflect() protoreflect.Message {
func (x *RecordInvocationRequest) ProtoReflect() protoreflect.Message {
mi := &file_inteld_proto_inteld_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -309,40 +309,127 @@ func (x *ReportInvocationRequest) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use ReportInvocationRequest.ProtoReflect.Descriptor instead.
func (*ReportInvocationRequest) Descriptor() ([]byte, []int) {
// Deprecated: Use RecordInvocationRequest.ProtoReflect.Descriptor instead.
func (*RecordInvocationRequest) Descriptor() ([]byte, []int) {
return file_inteld_proto_inteld_proto_rawDescGZIP(), []int{4}
}
func (x *ReportInvocationRequest) GetInvocations() []*Invocation {
func (x *RecordInvocationRequest) GetInvocations() []*Invocation {
if x != nil {
return x.Invocations
}
return nil
}
type InstalledSoftware struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
DockerDesktop bool `protobuf:"varint,1,opt,name=docker_desktop,json=dockerDesktop,proto3" json:"docker_desktop,omitempty"`
DockerDesktopEnterprise bool `protobuf:"varint,2,opt,name=docker_desktop_enterprise,json=dockerDesktopEnterprise,proto3" json:"docker_desktop_enterprise,omitempty"`
Vscode bool `protobuf:"varint,3,opt,name=vscode,proto3" json:"vscode,omitempty"`
VscodeInsiders bool `protobuf:"varint,4,opt,name=vscode_insiders,json=vscodeInsiders,proto3" json:"vscode_insiders,omitempty"`
JetbrainsIntellij bool `protobuf:"varint,5,opt,name=jetbrains_intellij,json=jetbrainsIntellij,proto3" json:"jetbrains_intellij,omitempty"`
JetbrainsGateway bool `protobuf:"varint,6,opt,name=jetbrains_gateway,json=jetbrainsGateway,proto3" json:"jetbrains_gateway,omitempty"`
}
func (x *InstalledSoftware) Reset() {
*x = InstalledSoftware{}
if protoimpl.UnsafeEnabled {
mi := &file_inteld_proto_inteld_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *InstalledSoftware) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*InstalledSoftware) ProtoMessage() {}
func (x *InstalledSoftware) ProtoReflect() protoreflect.Message {
mi := &file_inteld_proto_inteld_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 InstalledSoftware.ProtoReflect.Descriptor instead.
func (*InstalledSoftware) Descriptor() ([]byte, []int) {
return file_inteld_proto_inteld_proto_rawDescGZIP(), []int{5}
}
func (x *InstalledSoftware) GetDockerDesktop() bool {
if x != nil {
return x.DockerDesktop
}
return false
}
func (x *InstalledSoftware) GetDockerDesktopEnterprise() bool {
if x != nil {
return x.DockerDesktopEnterprise
}
return false
}
func (x *InstalledSoftware) GetVscode() bool {
if x != nil {
return x.Vscode
}
return false
}
func (x *InstalledSoftware) GetVscodeInsiders() bool {
if x != nil {
return x.VscodeInsiders
}
return false
}
func (x *InstalledSoftware) GetJetbrainsIntellij() bool {
if x != nil {
return x.JetbrainsIntellij
}
return false
}
func (x *InstalledSoftware) GetJetbrainsGateway() bool {
if x != nil {
return x.JetbrainsGateway
}
return false
}
type RegisterRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
MachineId string `protobuf:"bytes,1,opt,name=machine_id,json=machineId,proto3" json:"machine_id,omitempty"`
Hostname string `protobuf:"bytes,2,opt,name=hostname,proto3" json:"hostname,omitempty"`
Hostname string `protobuf:"bytes,1,opt,name=hostname,proto3" json:"hostname,omitempty"`
// GOOS
OperatingSystem string `protobuf:"bytes,3,opt,name=operating_system,json=operatingSystem,proto3" json:"operating_system,omitempty"`
OperatingSystemVersion string `protobuf:"bytes,4,opt,name=operating_system_version,json=operatingSystemVersion,proto3" json:"operating_system_version,omitempty"`
CpuCores uint32 `protobuf:"varint,5,opt,name=cpu_cores,json=cpuCores,proto3" json:"cpu_cores,omitempty"`
MemoryTotal uint64 `protobuf:"varint,6,opt,name=memory_total,json=memoryTotal,proto3" json:"memory_total,omitempty"`
OperatingSystem string `protobuf:"bytes,2,opt,name=operating_system,json=operatingSystem,proto3" json:"operating_system,omitempty"`
OperatingSystemVersion string `protobuf:"bytes,3,opt,name=operating_system_version,json=operatingSystemVersion,proto3" json:"operating_system_version,omitempty"`
CpuCores uint32 `protobuf:"varint,4,opt,name=cpu_cores,json=cpuCores,proto3" json:"cpu_cores,omitempty"`
MemoryTotal uint64 `protobuf:"varint,5,opt,name=memory_total,json=memoryTotal,proto3" json:"memory_total,omitempty"`
// GOARCH
Architecture string `protobuf:"bytes,7,opt,name=architecture,proto3" json:"architecture,omitempty"`
GitConfigEmail string `protobuf:"bytes,8,opt,name=git_config_email,json=gitConfigEmail,proto3" json:"git_config_email,omitempty"`
GitConfigName string `protobuf:"bytes,9,opt,name=git_config_name,json=gitConfigName,proto3" json:"git_config_name,omitempty"`
Architecture string `protobuf:"bytes,6,opt,name=architecture,proto3" json:"architecture,omitempty"`
GitConfigEmail string `protobuf:"bytes,7,opt,name=git_config_email,json=gitConfigEmail,proto3" json:"git_config_email,omitempty"`
GitConfigName string `protobuf:"bytes,8,opt,name=git_config_name,json=gitConfigName,proto3" json:"git_config_name,omitempty"`
InstalledSoftware *InstalledSoftware `protobuf:"bytes,9,opt,name=installed_software,json=installedSoftware,proto3" json:"installed_software,omitempty"`
}
func (x *RegisterRequest) Reset() {
*x = RegisterRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_inteld_proto_inteld_proto_msgTypes[5]
mi := &file_inteld_proto_inteld_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -355,7 +442,7 @@ func (x *RegisterRequest) String() string {
func (*RegisterRequest) ProtoMessage() {}
func (x *RegisterRequest) ProtoReflect() protoreflect.Message {
mi := &file_inteld_proto_inteld_proto_msgTypes[5]
mi := &file_inteld_proto_inteld_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -368,14 +455,7 @@ func (x *RegisterRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use RegisterRequest.ProtoReflect.Descriptor instead.
func (*RegisterRequest) Descriptor() ([]byte, []int) {
return file_inteld_proto_inteld_proto_rawDescGZIP(), []int{5}
}
func (x *RegisterRequest) GetMachineId() string {
if x != nil {
return x.MachineId
}
return ""
return file_inteld_proto_inteld_proto_rawDescGZIP(), []int{6}
}
func (x *RegisterRequest) GetHostname() string {
@ -434,6 +514,13 @@ func (x *RegisterRequest) GetGitConfigName() string {
return ""
}
func (x *RegisterRequest) GetInstalledSoftware() *InstalledSoftware {
if x != nil {
return x.InstalledSoftware
}
return nil
}
// SystemResponse is a message that the client streams to
// the daemon. It notifies of new tracking requests.
type SystemResponse struct {
@ -450,7 +537,7 @@ type SystemResponse struct {
func (x *SystemResponse) Reset() {
*x = SystemResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_inteld_proto_inteld_proto_msgTypes[6]
mi := &file_inteld_proto_inteld_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -463,7 +550,7 @@ func (x *SystemResponse) String() string {
func (*SystemResponse) ProtoMessage() {}
func (x *SystemResponse) ProtoReflect() protoreflect.Message {
mi := &file_inteld_proto_inteld_proto_msgTypes[6]
mi := &file_inteld_proto_inteld_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -476,7 +563,7 @@ func (x *SystemResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use SystemResponse.ProtoReflect.Descriptor instead.
func (*SystemResponse) Descriptor() ([]byte, []int) {
return file_inteld_proto_inteld_proto_rawDescGZIP(), []int{6}
return file_inteld_proto_inteld_proto_rawDescGZIP(), []int{7}
}
func (m *SystemResponse) GetMessage() isSystemResponse_Message {
@ -516,7 +603,7 @@ type TrackExecutables struct {
func (x *TrackExecutables) Reset() {
*x = TrackExecutables{}
if protoimpl.UnsafeEnabled {
mi := &file_inteld_proto_inteld_proto_msgTypes[7]
mi := &file_inteld_proto_inteld_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -529,7 +616,7 @@ func (x *TrackExecutables) String() string {
func (*TrackExecutables) ProtoMessage() {}
func (x *TrackExecutables) ProtoReflect() protoreflect.Message {
mi := &file_inteld_proto_inteld_proto_msgTypes[7]
mi := &file_inteld_proto_inteld_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -542,7 +629,7 @@ func (x *TrackExecutables) ProtoReflect() protoreflect.Message {
// Deprecated: Use TrackExecutables.ProtoReflect.Descriptor instead.
func (*TrackExecutables) Descriptor() ([]byte, []int) {
return file_inteld_proto_inteld_proto_rawDescGZIP(), []int{7}
return file_inteld_proto_inteld_proto_rawDescGZIP(), []int{8}
}
func (x *TrackExecutables) GetBinaryName() []string {
@ -552,6 +639,93 @@ func (x *TrackExecutables) GetBinaryName() []string {
return nil
}
type ReportInvocationRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ExecutablePath string `protobuf:"bytes,1,opt,name=executable_path,json=executablePath,proto3" json:"executable_path,omitempty"`
Arguments []string `protobuf:"bytes,2,rep,name=arguments,proto3" json:"arguments,omitempty"`
StartedAt int64 `protobuf:"varint,3,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"`
FinishedAt int64 `protobuf:"varint,4,opt,name=finished_at,json=finishedAt,proto3" json:"finished_at,omitempty"`
ExitCode int32 `protobuf:"varint,5,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"`
WorkingDirectory string `protobuf:"bytes,6,opt,name=working_directory,json=workingDirectory,proto3" json:"working_directory,omitempty"`
}
func (x *ReportInvocationRequest) Reset() {
*x = ReportInvocationRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_inteld_proto_inteld_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ReportInvocationRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ReportInvocationRequest) ProtoMessage() {}
func (x *ReportInvocationRequest) ProtoReflect() protoreflect.Message {
mi := &file_inteld_proto_inteld_proto_msgTypes[9]
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 ReportInvocationRequest.ProtoReflect.Descriptor instead.
func (*ReportInvocationRequest) Descriptor() ([]byte, []int) {
return file_inteld_proto_inteld_proto_rawDescGZIP(), []int{9}
}
func (x *ReportInvocationRequest) GetExecutablePath() string {
if x != nil {
return x.ExecutablePath
}
return ""
}
func (x *ReportInvocationRequest) GetArguments() []string {
if x != nil {
return x.Arguments
}
return nil
}
func (x *ReportInvocationRequest) GetStartedAt() int64 {
if x != nil {
return x.StartedAt
}
return 0
}
func (x *ReportInvocationRequest) GetFinishedAt() int64 {
if x != nil {
return x.FinishedAt
}
return 0
}
func (x *ReportInvocationRequest) GetExitCode() int32 {
if x != nil {
return x.ExitCode
}
return 0
}
func (x *ReportInvocationRequest) GetWorkingDirectory() string {
if x != nil {
return x.WorkingDirectory
}
return ""
}
var File_inteld_proto_inteld_proto protoreflect.FileDescriptor
var file_inteld_proto_inteld_proto_rawDesc = []byte{
@ -586,60 +760,100 @@ var file_inteld_proto_inteld_proto_rawDesc = []byte{
0x0a, 0x0b, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x6c, 0x64, 0x2e, 0x45, 0x78, 0x65,
0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x0b, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x61,
0x62, 0x6c, 0x65, 0x73, 0x22, 0x4f, 0x0a, 0x17, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e,
0x62, 0x6c, 0x65, 0x73, 0x22, 0x4f, 0x0a, 0x17, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x49, 0x6e,
0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x34, 0x0a, 0x0b, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x6c, 0x64, 0x2e, 0x49, 0x6e,
0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xe7, 0x02, 0x0a, 0x0f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74,
0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x63,
0x68, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d,
0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74,
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74,
0x6e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e,
0x67, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f,
0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x12,
0x38, 0x0a, 0x18, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x79, 0x73,
0x74, 0x65, 0x6d, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28,
0x09, 0x52, 0x16, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x79, 0x73, 0x74,
0x65, 0x6d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x70, 0x75,
0x5f, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x63, 0x70,
0x75, 0x43, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79,
0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x6d, 0x65,
0x6d, 0x6f, 0x72, 0x79, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x22, 0x0a, 0x0c, 0x61, 0x72, 0x63,
0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x12, 0x28, 0x0a,
0x10, 0x67, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x65, 0x6d, 0x61, 0x69,
0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x67, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x26, 0x0a, 0x0f, 0x67, 0x69, 0x74, 0x5f, 0x63,
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09,
0x52, 0x0d, 0x67, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x22,
0x64, 0x0a, 0x0e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x47, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75,
0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x69,
0x6e, 0x74, 0x65, 0x6c, 0x64, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x45, 0x78, 0x65, 0x63, 0x75,
0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x48, 0x00, 0x52, 0x10, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x45,
0x78, 0x65, 0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65,
0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x33, 0x0a, 0x10, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x45, 0x78,
0x65, 0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x69, 0x6e,
0x61, 0x72, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a,
0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x32, 0xc8, 0x01, 0x0a, 0x0b, 0x49,
0x6e, 0x74, 0x65, 0x6c, 0x44, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x08, 0x52, 0x65,
0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x6c, 0x64, 0x2e,
0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x16, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x6c, 0x64, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x42, 0x0a, 0x10, 0x52, 0x65, 0x63,
0x6f, 0x72, 0x64, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x2e,
0x69, 0x6e, 0x74, 0x65, 0x6c, 0x64, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x76,
0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d,
0x2e, 0x69, 0x6e, 0x74, 0x65, 0x6c, 0x64, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x36, 0x0a,
0x0a, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x61, 0x74, 0x68, 0x12, 0x19, 0x2e, 0x69, 0x6e,
0x74, 0x65, 0x6c, 0x64, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x61, 0x74, 0x68, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x6c, 0x64, 0x2e,
0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2f,
0x76, 0x32, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x6c, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x93, 0x02, 0x0a, 0x11, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c,
0x6c, 0x65, 0x64, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x64,
0x6f, 0x63, 0x6b, 0x65, 0x72, 0x5f, 0x64, 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x18, 0x01, 0x20,
0x01, 0x28, 0x08, 0x52, 0x0d, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x44, 0x65, 0x73, 0x6b, 0x74,
0x6f, 0x70, 0x12, 0x3a, 0x0a, 0x19, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x5f, 0x64, 0x65, 0x73,
0x6b, 0x74, 0x6f, 0x70, 0x5f, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x18,
0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x44, 0x65, 0x73,
0x6b, 0x74, 0x6f, 0x70, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x12, 0x16,
0x0a, 0x06, 0x76, 0x73, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06,
0x76, 0x73, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x76, 0x73, 0x63, 0x6f, 0x64, 0x65,
0x5f, 0x69, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52,
0x0e, 0x76, 0x73, 0x63, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, 0x73, 0x12,
0x2d, 0x0a, 0x12, 0x6a, 0x65, 0x74, 0x62, 0x72, 0x61, 0x69, 0x6e, 0x73, 0x5f, 0x69, 0x6e, 0x74,
0x65, 0x6c, 0x6c, 0x69, 0x6a, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x6a, 0x65, 0x74,
0x62, 0x72, 0x61, 0x69, 0x6e, 0x73, 0x49, 0x6e, 0x74, 0x65, 0x6c, 0x6c, 0x69, 0x6a, 0x12, 0x2b,
0x0a, 0x11, 0x6a, 0x65, 0x74, 0x62, 0x72, 0x61, 0x69, 0x6e, 0x73, 0x5f, 0x67, 0x61, 0x74, 0x65,
0x77, 0x61, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x6a, 0x65, 0x74, 0x62, 0x72,
0x61, 0x69, 0x6e, 0x73, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x22, 0x92, 0x03, 0x0a, 0x0f,
0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x6f,
0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67,
0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x12, 0x38, 0x0a, 0x18, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74,
0x69, 0x6e, 0x67, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69,
0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74,
0x69, 0x6e, 0x67, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
0x12, 0x1b, 0x0a, 0x09, 0x63, 0x70, 0x75, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0x04, 0x20,
0x01, 0x28, 0x0d, 0x52, 0x08, 0x63, 0x70, 0x75, 0x43, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x21, 0x0a,
0x0c, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x05, 0x20,
0x01, 0x28, 0x04, 0x52, 0x0b, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x54, 0x6f, 0x74, 0x61, 0x6c,
0x12, 0x22, 0x0a, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65,
0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63,
0x74, 0x75, 0x72, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x67, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e,
0x67, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x26,
0x0a, 0x0f, 0x67, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x67, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x48, 0x0a, 0x12, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c,
0x6c, 0x65, 0x64, 0x5f, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x18, 0x09, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x19, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x6c, 0x64, 0x2e, 0x49, 0x6e, 0x73, 0x74,
0x61, 0x6c, 0x6c, 0x65, 0x64, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x52, 0x11, 0x69,
0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
0x22, 0x64, 0x0a, 0x0e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x47, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x5f, 0x65, 0x78, 0x65, 0x63,
0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e,
0x69, 0x6e, 0x74, 0x65, 0x6c, 0x64, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x45, 0x78, 0x65, 0x63,
0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x48, 0x00, 0x52, 0x10, 0x74, 0x72, 0x61, 0x63, 0x6b,
0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x6d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x33, 0x0a, 0x10, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x45,
0x78, 0x65, 0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x69,
0x6e, 0x61, 0x72, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52,
0x0a, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xea, 0x01, 0x0a, 0x17,
0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x65, 0x63, 0x75,
0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x0e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68,
0x12, 0x1c, 0x0a, 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20,
0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1d,
0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01,
0x28, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1f, 0x0a,
0x0b, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01,
0x28, 0x03, 0x52, 0x0a, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1b,
0x0a, 0x09, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28,
0x05, 0x52, 0x08, 0x65, 0x78, 0x69, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x77,
0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79,
0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x44,
0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x32, 0xc8, 0x01, 0x0a, 0x0b, 0x49, 0x6e, 0x74,
0x65, 0x6c, 0x44, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69,
0x73, 0x74, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x6c, 0x64, 0x2e, 0x52, 0x65,
0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e,
0x69, 0x6e, 0x74, 0x65, 0x6c, 0x64, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x42, 0x0a, 0x10, 0x52, 0x65, 0x63, 0x6f, 0x72,
0x64, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x2e, 0x69, 0x6e,
0x74, 0x65, 0x6c, 0x64, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x49, 0x6e, 0x76, 0x6f, 0x63,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x69,
0x6e, 0x74, 0x65, 0x6c, 0x64, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x36, 0x0a, 0x0a, 0x52,
0x65, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x61, 0x74, 0x68, 0x12, 0x19, 0x2e, 0x69, 0x6e, 0x74, 0x65,
0x6c, 0x64, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x6c, 0x64, 0x2e, 0x45, 0x6d,
0x70, 0x74, 0x79, 0x32, 0x51, 0x0a, 0x0b, 0x49, 0x6e, 0x74, 0x65, 0x6c, 0x43, 0x6c, 0x69, 0x65,
0x6e, 0x74, 0x12, 0x42, 0x0a, 0x10, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x76, 0x6f,
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x6c, 0x64, 0x2e,
0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x6c, 0x64,
0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x72,
0x2f, 0x76, 0x32, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x6c, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -654,33 +868,38 @@ func file_inteld_proto_inteld_proto_rawDescGZIP() []byte {
return file_inteld_proto_inteld_proto_rawDescData
}
var file_inteld_proto_inteld_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_inteld_proto_inteld_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
var file_inteld_proto_inteld_proto_goTypes = []interface{}{
(*Empty)(nil), // 0: inteld.Empty
(*Executable)(nil), // 1: inteld.Executable
(*Invocation)(nil), // 2: inteld.Invocation
(*ReportPathRequest)(nil), // 3: inteld.ReportPathRequest
(*ReportInvocationRequest)(nil), // 4: inteld.ReportInvocationRequest
(*RegisterRequest)(nil), // 5: inteld.RegisterRequest
(*SystemResponse)(nil), // 6: inteld.SystemResponse
(*TrackExecutables)(nil), // 7: inteld.TrackExecutables
(*RecordInvocationRequest)(nil), // 4: inteld.RecordInvocationRequest
(*InstalledSoftware)(nil), // 5: inteld.InstalledSoftware
(*RegisterRequest)(nil), // 6: inteld.RegisterRequest
(*SystemResponse)(nil), // 7: inteld.SystemResponse
(*TrackExecutables)(nil), // 8: inteld.TrackExecutables
(*ReportInvocationRequest)(nil), // 9: inteld.ReportInvocationRequest
}
var file_inteld_proto_inteld_proto_depIdxs = []int32{
1, // 0: inteld.Invocation.executable:type_name -> inteld.Executable
1, // 1: inteld.ReportPathRequest.executables:type_name -> inteld.Executable
2, // 2: inteld.ReportInvocationRequest.invocations:type_name -> inteld.Invocation
7, // 3: inteld.SystemResponse.track_executables:type_name -> inteld.TrackExecutables
5, // 4: inteld.IntelDaemon.Register:input_type -> inteld.RegisterRequest
4, // 5: inteld.IntelDaemon.RecordInvocation:input_type -> inteld.ReportInvocationRequest
3, // 6: inteld.IntelDaemon.ReportPath:input_type -> inteld.ReportPathRequest
6, // 7: inteld.IntelDaemon.Register:output_type -> inteld.SystemResponse
0, // 8: inteld.IntelDaemon.RecordInvocation:output_type -> inteld.Empty
0, // 9: inteld.IntelDaemon.ReportPath:output_type -> inteld.Empty
7, // [7:10] is the sub-list for method output_type
4, // [4:7] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
2, // 2: inteld.RecordInvocationRequest.invocations:type_name -> inteld.Invocation
5, // 3: inteld.RegisterRequest.installed_software:type_name -> inteld.InstalledSoftware
8, // 4: inteld.SystemResponse.track_executables:type_name -> inteld.TrackExecutables
6, // 5: inteld.IntelDaemon.Register:input_type -> inteld.RegisterRequest
4, // 6: inteld.IntelDaemon.RecordInvocation:input_type -> inteld.RecordInvocationRequest
3, // 7: inteld.IntelDaemon.ReportPath:input_type -> inteld.ReportPathRequest
9, // 8: inteld.IntelClient.ReportInvocation:input_type -> inteld.ReportInvocationRequest
7, // 9: inteld.IntelDaemon.Register:output_type -> inteld.SystemResponse
0, // 10: inteld.IntelDaemon.RecordInvocation:output_type -> inteld.Empty
0, // 11: inteld.IntelDaemon.ReportPath:output_type -> inteld.Empty
0, // 12: inteld.IntelClient.ReportInvocation:output_type -> inteld.Empty
9, // [9:13] is the sub-list for method output_type
5, // [5:9] is the sub-list for method input_type
5, // [5:5] is the sub-list for extension type_name
5, // [5:5] is the sub-list for extension extendee
0, // [0:5] is the sub-list for field type_name
}
func init() { file_inteld_proto_inteld_proto_init() }
@ -738,7 +957,7 @@ func file_inteld_proto_inteld_proto_init() {
}
}
file_inteld_proto_inteld_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ReportInvocationRequest); i {
switch v := v.(*RecordInvocationRequest); i {
case 0:
return &v.state
case 1:
@ -750,7 +969,7 @@ func file_inteld_proto_inteld_proto_init() {
}
}
file_inteld_proto_inteld_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RegisterRequest); i {
switch v := v.(*InstalledSoftware); i {
case 0:
return &v.state
case 1:
@ -762,7 +981,7 @@ func file_inteld_proto_inteld_proto_init() {
}
}
file_inteld_proto_inteld_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SystemResponse); i {
switch v := v.(*RegisterRequest); i {
case 0:
return &v.state
case 1:
@ -774,6 +993,18 @@ func file_inteld_proto_inteld_proto_init() {
}
}
file_inteld_proto_inteld_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SystemResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_inteld_proto_inteld_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TrackExecutables); i {
case 0:
return &v.state
@ -785,8 +1016,20 @@ func file_inteld_proto_inteld_proto_init() {
return nil
}
}
file_inteld_proto_inteld_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ReportInvocationRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_inteld_proto_inteld_proto_msgTypes[6].OneofWrappers = []interface{}{
file_inteld_proto_inteld_proto_msgTypes[7].OneofWrappers = []interface{}{
(*SystemResponse_TrackExecutables)(nil),
}
type x struct{}
@ -795,9 +1038,9 @@ func file_inteld_proto_inteld_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_inteld_proto_inteld_proto_rawDesc,
NumEnums: 0,
NumMessages: 8,
NumMessages: 10,
NumExtensions: 0,
NumServices: 1,
NumServices: 2,
},
GoTypes: file_inteld_proto_inteld_proto_goTypes,
DependencyIndexes: file_inteld_proto_inteld_proto_depIdxs,

View File

@ -30,22 +30,31 @@ message ReportPathRequest {
repeated Executable executables = 1;
}
message ReportInvocationRequest {
message RecordInvocationRequest {
repeated Invocation invocations = 1;
}
message InstalledSoftware {
bool docker_desktop = 1;
bool docker_desktop_enterprise = 2;
bool vscode = 3;
bool vscode_insiders = 4;
bool jetbrains_intellij = 5;
bool jetbrains_gateway = 6;
}
message RegisterRequest {
string machine_id = 1;
string hostname = 2;
string hostname = 1;
// GOOS
string operating_system = 3;
string operating_system_version = 4;
uint32 cpu_cores = 5;
uint64 memory_total = 6;
string operating_system = 2;
string operating_system_version = 3;
uint32 cpu_cores = 4;
uint64 memory_total = 5;
// GOARCH
string architecture = 7;
string git_config_email = 8;
string git_config_name = 9;
string architecture = 6;
string git_config_email = 7;
string git_config_name = 8;
InstalledSoftware installed_software = 9;
}
// SystemResponse is a message that the client streams to
@ -62,12 +71,33 @@ message TrackExecutables {
repeated string binary_name = 1;
}
// IntelDaemon is the daemon interface that communicates
// with coderd.
service IntelDaemon {
// Register must be sent before any other message.
// If the system is not registered, all other messages will
// fail with errors.
rpc Register(RegisterRequest) returns (stream SystemResponse);
rpc RecordInvocation(ReportInvocationRequest) returns (Empty);
rpc RecordInvocation(RecordInvocationRequest) returns (Empty);
rpc ReportPath(ReportPathRequest) returns (Empty);
}
// Client messages!
message ReportInvocationRequest {
string executable_path = 1;
repeated string arguments = 2;
int64 started_at = 3;
int64 finished_at = 4;
int32 exit_code = 5;
string working_directory = 6;
}
// IntelClient is provided by inteld to clients that want
// to report insights. Clients report through the daemon
// to ensure that the insights are stored and processed
// in a consistent and timely manner.
service IntelClient {
rpc ReportInvocation(ReportInvocationRequest) returns (Empty);
}

View File

@ -39,7 +39,7 @@ type DRPCIntelDaemonClient interface {
DRPCConn() drpc.Conn
Register(ctx context.Context, in *RegisterRequest) (DRPCIntelDaemon_RegisterClient, error)
RecordInvocation(ctx context.Context, in *ReportInvocationRequest) (*Empty, error)
RecordInvocation(ctx context.Context, in *RecordInvocationRequest) (*Empty, error)
ReportPath(ctx context.Context, in *ReportPathRequest) (*Empty, error)
}
@ -93,7 +93,7 @@ func (x *drpcIntelDaemon_RegisterClient) RecvMsg(m *SystemResponse) error {
return x.MsgRecv(m, drpcEncoding_File_inteld_proto_inteld_proto{})
}
func (c *drpcIntelDaemonClient) RecordInvocation(ctx context.Context, in *ReportInvocationRequest) (*Empty, error) {
func (c *drpcIntelDaemonClient) RecordInvocation(ctx context.Context, in *RecordInvocationRequest) (*Empty, error) {
out := new(Empty)
err := c.cc.Invoke(ctx, "/inteld.IntelDaemon/RecordInvocation", drpcEncoding_File_inteld_proto_inteld_proto{}, in, out)
if err != nil {
@ -113,7 +113,7 @@ func (c *drpcIntelDaemonClient) ReportPath(ctx context.Context, in *ReportPathRe
type DRPCIntelDaemonServer interface {
Register(*RegisterRequest, DRPCIntelDaemon_RegisterStream) error
RecordInvocation(context.Context, *ReportInvocationRequest) (*Empty, error)
RecordInvocation(context.Context, *RecordInvocationRequest) (*Empty, error)
ReportPath(context.Context, *ReportPathRequest) (*Empty, error)
}
@ -123,7 +123,7 @@ func (s *DRPCIntelDaemonUnimplementedServer) Register(*RegisterRequest, DRPCInte
return drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
}
func (s *DRPCIntelDaemonUnimplementedServer) RecordInvocation(context.Context, *ReportInvocationRequest) (*Empty, error) {
func (s *DRPCIntelDaemonUnimplementedServer) RecordInvocation(context.Context, *RecordInvocationRequest) (*Empty, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
}
@ -152,7 +152,7 @@ func (DRPCIntelDaemonDescription) Method(n int) (string, drpc.Encoding, drpc.Rec
return srv.(DRPCIntelDaemonServer).
RecordInvocation(
ctx,
in1.(*ReportInvocationRequest),
in1.(*RecordInvocationRequest),
)
}, DRPCIntelDaemonServer.RecordInvocation, true
case 2:
@ -217,3 +217,78 @@ func (x *drpcIntelDaemon_ReportPathStream) SendAndClose(m *Empty) error {
}
return x.CloseSend()
}
type DRPCIntelClientClient interface {
DRPCConn() drpc.Conn
ReportInvocation(ctx context.Context, in *ReportInvocationRequest) (*Empty, error)
}
type drpcIntelClientClient struct {
cc drpc.Conn
}
func NewDRPCIntelClientClient(cc drpc.Conn) DRPCIntelClientClient {
return &drpcIntelClientClient{cc}
}
func (c *drpcIntelClientClient) DRPCConn() drpc.Conn { return c.cc }
func (c *drpcIntelClientClient) ReportInvocation(ctx context.Context, in *ReportInvocationRequest) (*Empty, error) {
out := new(Empty)
err := c.cc.Invoke(ctx, "/inteld.IntelClient/ReportInvocation", drpcEncoding_File_inteld_proto_inteld_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
type DRPCIntelClientServer interface {
ReportInvocation(context.Context, *ReportInvocationRequest) (*Empty, error)
}
type DRPCIntelClientUnimplementedServer struct{}
func (s *DRPCIntelClientUnimplementedServer) ReportInvocation(context.Context, *ReportInvocationRequest) (*Empty, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
}
type DRPCIntelClientDescription struct{}
func (DRPCIntelClientDescription) NumMethods() int { return 1 }
func (DRPCIntelClientDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
switch n {
case 0:
return "/inteld.IntelClient/ReportInvocation", drpcEncoding_File_inteld_proto_inteld_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCIntelClientServer).
ReportInvocation(
ctx,
in1.(*ReportInvocationRequest),
)
}, DRPCIntelClientServer.ReportInvocation, true
default:
return "", nil, nil, nil, false
}
}
func DRPCRegisterIntelClient(mux drpc.Mux, impl DRPCIntelClientServer) error {
return mux.Register(impl, DRPCIntelClientDescription{})
}
type DRPCIntelClient_ReportInvocationStream interface {
drpc.Stream
SendAndClose(*Empty) error
}
type drpcIntelClient_ReportInvocationStream struct {
drpc.Stream
}
func (x *drpcIntelClient_ReportInvocationStream) SendAndClose(m *Empty) error {
if err := x.MsgSend(m, drpcEncoding_File_inteld_proto_inteld_proto{}); err != nil {
return err
}
return x.CloseSend()
}