Implement api selector for all runners
This commit is contained in:
parent
0a7152d6b8
commit
ff06b92ffd
@ -17,7 +17,7 @@ import (
|
|||||||
"git.grassecon.net/grassrootseconomics/sarafu-vise/config"
|
"git.grassecon.net/grassrootseconomics/sarafu-vise/config"
|
||||||
"git.grassecon.net/grassrootseconomics/visedriver/storage"
|
"git.grassecon.net/grassrootseconomics/visedriver/storage"
|
||||||
"git.grassecon.net/grassrootseconomics/visedriver/request"
|
"git.grassecon.net/grassrootseconomics/visedriver/request"
|
||||||
httpremote "git.grassecon.net/grassrootseconomics/sarafu-api/remote/http"
|
"git.grassecon.net/grassrootseconomics/sarafu-vise/services"
|
||||||
"git.grassecon.net/grassrootseconomics/sarafu-vise/args"
|
"git.grassecon.net/grassrootseconomics/sarafu-vise/args"
|
||||||
"git.grassecon.net/grassrootseconomics/sarafu-vise/handlers"
|
"git.grassecon.net/grassrootseconomics/sarafu-vise/handlers"
|
||||||
)
|
)
|
||||||
@ -125,7 +125,8 @@ func main() {
|
|||||||
|
|
||||||
lhs, err := handlers.NewLocalHandlerService(ctx, pfp, true, dbResource, cfg, rs)
|
lhs, err := handlers.NewLocalHandlerService(ctx, pfp, true, dbResource, cfg, rs)
|
||||||
lhs.SetDataStore(&userdataStore)
|
lhs.SetDataStore(&userdataStore)
|
||||||
accountService := &httpremote.HTTPAccountService{}
|
|
||||||
|
accountService := services.New(ctx, menuStorageService, connData)
|
||||||
|
|
||||||
hl, err := lhs.GetHandler(accountService)
|
hl, err := lhs.GetHandler(accountService)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -21,7 +21,7 @@ import (
|
|||||||
"git.grassecon.net/grassrootseconomics/visedriver/request"
|
"git.grassecon.net/grassrootseconomics/visedriver/request"
|
||||||
"git.grassecon.net/grassrootseconomics/visedriver/storage"
|
"git.grassecon.net/grassrootseconomics/visedriver/storage"
|
||||||
|
|
||||||
httpremote "git.grassecon.net/grassrootseconomics/sarafu-api/remote/http"
|
"git.grassecon.net/grassrootseconomics/sarafu-vise/services"
|
||||||
"git.grassecon.net/grassrootseconomics/sarafu-vise/args"
|
"git.grassecon.net/grassrootseconomics/sarafu-vise/args"
|
||||||
"git.grassecon.net/grassrootseconomics/sarafu-vise/handlers"
|
"git.grassecon.net/grassrootseconomics/sarafu-vise/handlers"
|
||||||
)
|
)
|
||||||
@ -116,7 +116,8 @@ func main() {
|
|||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
accountService := &httpremote.HTTPAccountService{}
|
accountService := services.New(ctx, menuStorageService, connData)
|
||||||
|
|
||||||
hl, err := lhs.GetHandler(accountService)
|
hl, err := lhs.GetHandler(accountService)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, err.Error())
|
fmt.Fprintf(os.Stderr, err.Error())
|
||||||
@ -130,6 +131,8 @@ func main() {
|
|||||||
}
|
}
|
||||||
defer stateStore.Close()
|
defer stateStore.Close()
|
||||||
|
|
||||||
|
//accountService := services.New(ctx, menuStorageService, connData)
|
||||||
|
|
||||||
rp := &httprequest.DefaultRequestParser{}
|
rp := &httprequest.DefaultRequestParser{}
|
||||||
bsh := request.NewBaseRequestHandler(cfg, rs, stateStore, userdataStore, rp, hl)
|
bsh := request.NewBaseRequestHandler(cfg, rs, stateStore, userdataStore, rp, hl)
|
||||||
sh := httprequest.NewHTTPRequestHandler(bsh)
|
sh := httprequest.NewHTTPRequestHandler(bsh)
|
||||||
|
@ -17,7 +17,7 @@ import (
|
|||||||
"git.defalsify.org/vise.git/resource"
|
"git.defalsify.org/vise.git/resource"
|
||||||
"git.defalsify.org/vise.git/state"
|
"git.defalsify.org/vise.git/state"
|
||||||
"git.grassecon.net/grassrootseconomics/visedriver/storage"
|
"git.grassecon.net/grassrootseconomics/visedriver/storage"
|
||||||
httpremote "git.grassecon.net/grassrootseconomics/sarafu-api/remote/http"
|
"git.grassecon.net/grassrootseconomics/sarafu-vise/services"
|
||||||
"git.grassecon.net/grassrootseconomics/sarafu-vise/handlers"
|
"git.grassecon.net/grassrootseconomics/sarafu-vise/handlers"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -180,7 +180,8 @@ func(s *SshRunner) GetEngine(sessionId string) (engine.Engine, func(), error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: clear up why pointer here and by-value other cmds
|
// TODO: clear up why pointer here and by-value other cmds
|
||||||
accountService := &httpremote.HTTPAccountService{}
|
accountService := services.New(ctx, menuStorageService, s.Conn)
|
||||||
|
|
||||||
hl, err := lhs.GetHandler(accountService)
|
hl, err := lhs.GetHandler(accountService)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user