mirror of
https://github.com/gazer-x/komari.git
synced 2026-06-22 00:05:52 +08:00
32 lines
717 B
Go
32 lines
717 B
Go
package api_rpc
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/komari-monitor/komari/pkg/rpc"
|
|
)
|
|
|
|
const GroupClient = "client"
|
|
|
|
func init() {
|
|
RegisterWithGroupAndMeta("register", GroupClient, registerClient, &rpc.MethodMeta{
|
|
Name: "RegisterClient",
|
|
Description: "Register a new client with the server (Auto discovery).",
|
|
Params: []rpc.ParamMeta{
|
|
{
|
|
Name: "name",
|
|
Type: "string",
|
|
Description: "The name of the client to register.",
|
|
},
|
|
},
|
|
})
|
|
}
|
|
|
|
func registerClient(ctx context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError) {
|
|
var params struct {
|
|
Name string `json:"name"`
|
|
}
|
|
req.BindParams(¶ms)
|
|
return nil, rpc.MakeError(rpc.InternalError, "Not impl yet", nil)
|
|
}
|