MCPcopy
hub / github.com/Ne0nd0g/merlin / Register

Method Register

pkg/services/rpc/rpc.go:186–193  ·  view source on GitHub ↗

Register is used by CLI clients to register with the RPC server

(ctx context.Context, e *emptypb.Empty)

Source from the content-addressed store, hash-verified

184
185// Register is used by CLI clients to register with the RPC server
186func (s *Server) Register(ctx context.Context, e *emptypb.Empty) (*pb.ID, error) {
187 slog.Log(context.Background(), logging.LevelTrace, "entering into function", "context", ctx, "empty", e)
188 cliClient := client.NewClient()
189 s.clientRepo.Add(cliClient)
190 s.messageChan[cliClient.ID()] = make(chan *pb.Message, 100)
191 slog.Info(fmt.Sprintf("Registered new RPC client with ID %s", cliClient.ID()))
192 return &pb.ID{Id: cliClient.ID().String()}, nil
193}
194
195// Socks creates a TCP listener on the provided port and forwards SOCKS5 traffic to the provided agent
196// in.Arguments[0] = method

Callers

nothing calls this directly

Calls 5

IDMethod · 0.95
NewClientFunction · 0.92
LogMethod · 0.65
AddMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected