Pushing changes for testing harness before my next meeting. Adding working exec library and sample code
Signed-off-by: Kris Nóva <kris@nivenly.com>
This commit is contained in:
parent
95794522e0
commit
b107d98a37
14 changed files with 313 additions and 19 deletions
41
sample-app/app.go
Normal file
41
sample-app/app.go
Normal file
|
@ -0,0 +1,41 @@
|
|||
package sampleapp
|
||||
|
||||
import (
|
||||
"github.com/kris-nova/logger"
|
||||
|
||||
photoprism "github.com/kris-nova/client-go"
|
||||
)
|
||||
|
||||
type SampleApplication struct {
|
||||
}
|
||||
|
||||
func New() *SampleApplication {
|
||||
app := &SampleApplication{}
|
||||
return app
|
||||
}
|
||||
|
||||
// These are the bash scripts that can be used
|
||||
// to start/stop the Photoprism test application
|
||||
var (
|
||||
CreateCommand = `./pcreate`
|
||||
DestroyCommand = `./pdestroy`
|
||||
LogsCommand = `./plogs`
|
||||
StartCommand = `./pstart`
|
||||
StopCommand = `./pstop`
|
||||
)
|
||||
|
||||
func (a *SampleApplication) Start() error {
|
||||
logger.Info("Starting Application...")
|
||||
script := NewScript(StartCommand)
|
||||
return script.Interpret()
|
||||
}
|
||||
|
||||
func (a *SampleApplication) Stop() error {
|
||||
logger.Info("Stopping Application...")
|
||||
script := NewScript(StopCommand)
|
||||
return script.Interpret()
|
||||
}
|
||||
|
||||
func (a *SampleApplication) GetAuth() photoprism.ClientAuthenticator {
|
||||
return nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue