Documentation ¶
Index ¶
- func ConnectionToDB(srv *App, dbStruct config.Database) error
- func RunCommand(script string, out chan<- string, errChan chan<- error)
- type App
- func (a *App) AllCommands() ([]CommandSmallInfo, error)
- func (a *App) AlreadyExist(data *Table) bool
- func (a *App) GracefulStop(serverCtx context.Context, sig <-chan os.Signal, ...)
- func (a *App) InfoAll(w http.ResponseWriter, r *http.Request)
- func (a *App) InfoCommand(param string) ([]Table, error)
- func (a *App) InfoCommands(w http.ResponseWriter, r *http.Request)
- func (a *App) InsertCommand(data *Table) error
- func (a *App) NewCommand(w http.ResponseWriter, r *http.Request)
- func (a *App) Remove(param string) error
- func (a *App) RemoveCommand(w http.ResponseWriter, r *http.Request)
- func (a *App) SetupRoutes() http.Handler
- type CommandSmallInfo
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectionToDB ¶
ConnectionToDB connects to the database and sets the connection to the App
func RunCommand ¶
RunCommand runs a bash script and returns the output or an error doing this asynchronously
Types ¶
type App ¶
func (*App) AllCommands ¶
func (a *App) AllCommands() ([]CommandSmallInfo, error)
AllCommands returns all commands from the database
func (*App) AlreadyExist ¶
AlreadyExist checks if a command already exists in the database
func (*App) GracefulStop ¶
func (a *App) GracefulStop(serverCtx context.Context, sig <-chan os.Signal, serverStopCtx context.CancelFunc)
GracefulStop stops the server gracefully
func (*App) InfoAll ¶
func (a *App) InfoAll(w http.ResponseWriter, r *http.Request)
InfoAll returns all commands
func (*App) InfoCommand ¶
InfoCommand returns a command by id or list of commands by ids
func (*App) InfoCommands ¶
func (a *App) InfoCommands(w http.ResponseWriter, r *http.Request)
InfoCommands returns a command by id or list of commands by ids
func (*App) InsertCommand ¶
InsertCommand inserts a command into the database and runs it
func (*App) NewCommand ¶
func (a *App) NewCommand(w http.ResponseWriter, r *http.Request)
NewCommand creates a new command in the database
func (*App) RemoveCommand ¶
func (a *App) RemoveCommand(w http.ResponseWriter, r *http.Request)
RemoveCommand removes a command or multiple commands from the database