package main import ( "basic-plugin/config" "os" "path/filepath" "linkfog.com/pluginx/pluginrpc" "linkfog.com/public/lib/l" ) func main() { pluginFuncs := map[string]PluginFunc{ "start": nil, "stop": nil, } pluginServer := newServer(config.ServicePluginName, pluginFuncs) dir, err := filepath.Abs(filepath.Dir(os.Args[0])) if err != nil { l.Errorf(err) os.Exit(1) } config.WorkDir = dir grpcServer, err := pluginrpc.NewPluginGrpcServer(filepath.Join(config.WorkDir, config.SockFile), pluginServer) if err != nil { l.Errorf("error creating plugin grpc server: %v", err) os.Exit(1) } defer grpcServer.Close() select {} }