Documentation ¶
Overview ¶
Package raza implements the commands to interact with the daemon.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ServerCmd = cobra.Command{
Use: "server",
Short: "Run the raza server",
}
View Source
var StartCmd = cobra.Command{ Use: "start", Short: "Start the raza server", Run: func(cmd *cobra.Command, args []string) { address, _ := cmd.Flags().GetString("address") lis, err := net.Listen("tcp", address) if err != nil { cmd.PrintErrf("Failed to listen: %v\n", err) return } s := grpc.NewServer() db, err := sql.Open("sqlite3", "./test.sqlite") if err != nil { log.Fatal().Err(err).Str("file", "./test.sqlite"). Stack().Msg("failed to open database") } server := NewServer(db) defer server.Close() raza.RegisterRazaShellWrapperServer(s, server) raza.RegisterRazaQueryServer(s, server) raza.RegisterRazaUserServer(s, server) log.Info().Str("address", address).Msgf("Starting gRPC listener on %s", address) if err := s.Serve(lis); err != nil { cmd.PrintErrf("Failed to serve: %v\n", err) return } }, }
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.