Gofmt, remove commented code

This commit is contained in:
lash 2025-01-21 15:43:26 +00:00
parent 2c8e60e1bb
commit 49335a290f
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
33 changed files with 181 additions and 191 deletions

View File

@ -10,7 +10,7 @@ type LangVar struct {
v []lang.Language v []lang.Language
} }
func(lv *LangVar) Set(s string) error { func (lv *LangVar) Set(s string) error {
v, err := lang.LanguageFromCode(s) v, err := lang.LanguageFromCode(s)
if err != nil { if err != nil {
return err return err
@ -19,16 +19,14 @@ func(lv *LangVar) Set(s string) error {
return err return err
} }
func(lv *LangVar) String() string { func (lv *LangVar) String() string {
var s []string var s []string
for _, v := range(lv.v) { for _, v := range lv.v {
s = append(s, v.Code) s = append(s, v.Code)
} }
return strings.Join(s, ",") return strings.Join(s, ",")
} }
func(lv *LangVar) Langs() []lang.Language { func (lv *LangVar) Langs() []lang.Language {
return lv.v return lv.v
} }

View File

@ -12,18 +12,18 @@ import (
"syscall" "syscall"
"git.defalsify.org/vise.git/engine" "git.defalsify.org/vise.git/engine"
"git.defalsify.org/vise.git/logging"
"git.defalsify.org/vise.git/lang" "git.defalsify.org/vise.git/lang"
"git.defalsify.org/vise.git/logging"
"git.defalsify.org/vise.git/resource" "git.defalsify.org/vise.git/resource"
"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/request" "git.grassecon.net/grassrootseconomics/visedriver/request"
"git.grassecon.net/grassrootseconomics/visedriver/storage"
at "git.grassecon.net/grassrootseconomics/visedriver-africastalking/africastalking"
"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"
"git.grassecon.net/grassrootseconomics/sarafu-vise/services" "git.grassecon.net/grassrootseconomics/sarafu-vise/services"
at "git.grassecon.net/grassrootseconomics/visedriver-africastalking/africastalking"
) )
var ( var (
@ -118,7 +118,7 @@ func main() {
} }
accountService := services.New(ctx, menuStorageService) accountService := services.New(ctx, menuStorageService)
hl, err := lhs.GetHandler(accountService) hl, err := lhs.GetHandler(accountService)
if err != nil { if err != nil {
fmt.Fprintf(os.Stderr, "httpaccountservice: %v\n", err) fmt.Fprintf(os.Stderr, "httpaccountservice: %v\n", err)

View File

@ -14,12 +14,12 @@ import (
"git.defalsify.org/vise.git/logging" "git.defalsify.org/vise.git/logging"
"git.defalsify.org/vise.git/resource" "git.defalsify.org/vise.git/resource"
"git.grassecon.net/grassrootseconomics/sarafu-vise/config"
"git.grassecon.net/grassrootseconomics/visedriver/storage"
"git.grassecon.net/grassrootseconomics/visedriver/request"
"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/config"
"git.grassecon.net/grassrootseconomics/sarafu-vise/handlers" "git.grassecon.net/grassrootseconomics/sarafu-vise/handlers"
"git.grassecon.net/grassrootseconomics/sarafu-vise/services"
"git.grassecon.net/grassrootseconomics/visedriver/request"
"git.grassecon.net/grassrootseconomics/visedriver/storage"
) )
var ( var (

View File

@ -17,13 +17,13 @@ import (
"git.defalsify.org/vise.git/resource" "git.defalsify.org/vise.git/resource"
"git.grassecon.net/grassrootseconomics/sarafu-vise/config" "git.grassecon.net/grassrootseconomics/sarafu-vise/config"
httprequest "git.grassecon.net/grassrootseconomics/visedriver/request/http"
"git.grassecon.net/grassrootseconomics/visedriver/request" "git.grassecon.net/grassrootseconomics/visedriver/request"
httprequest "git.grassecon.net/grassrootseconomics/visedriver/request/http"
"git.grassecon.net/grassrootseconomics/visedriver/storage" "git.grassecon.net/grassrootseconomics/visedriver/storage"
"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"
"git.grassecon.net/grassrootseconomics/sarafu-vise/services"
) )
var ( var (
@ -116,7 +116,7 @@ func main() {
} }
accountService := services.New(ctx, menuStorageService) accountService := services.New(ctx, menuStorageService)
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())

View File

@ -10,14 +10,14 @@ import (
"syscall" "syscall"
"git.defalsify.org/vise.git/engine" "git.defalsify.org/vise.git/engine"
"git.defalsify.org/vise.git/lang"
"git.defalsify.org/vise.git/logging" "git.defalsify.org/vise.git/logging"
"git.defalsify.org/vise.git/resource" "git.defalsify.org/vise.git/resource"
"git.defalsify.org/vise.git/lang"
"git.grassecon.net/grassrootseconomics/sarafu-vise/config"
"git.grassecon.net/grassrootseconomics/visedriver/storage"
"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/config"
"git.grassecon.net/grassrootseconomics/sarafu-vise/handlers" "git.grassecon.net/grassrootseconomics/sarafu-vise/handlers"
"git.grassecon.net/grassrootseconomics/sarafu-vise/services"
"git.grassecon.net/grassrootseconomics/visedriver/storage"
) )
var ( var (
@ -86,7 +86,7 @@ func main() {
fmt.Fprintf(os.Stderr, "menu storage service error: %v\n", err) fmt.Fprintf(os.Stderr, "menu storage service error: %v\n", err)
os.Exit(1) os.Exit(1)
} }
if gettextDir != "" { if gettextDir != "" {
menuStorageService = menuStorageService.WithGettext(gettextDir, langs.Langs()) menuStorageService = menuStorageService.WithGettext(gettextDir, langs.Langs())
} }

View File

@ -111,13 +111,13 @@ func main() {
signal.Notify(cterm, os.Interrupt, syscall.SIGTERM) signal.Notify(cterm, os.Interrupt, syscall.SIGTERM)
runner := &ssh.SshRunner{ runner := &ssh.SshRunner{
Cfg: cfg, Cfg: cfg,
Debug: engineDebug, Debug: engineDebug,
FlagFile: pfp, FlagFile: pfp,
Conn: conns, Conn: conns,
SrvKeyFile: sshKeyFile, SrvKeyFile: sshKeyFile,
Host: host, Host: host,
Port: port, Port: port,
} }
go func() { go func() {
select { select {

View File

@ -5,10 +5,10 @@ import (
) )
type Override struct { type Override struct {
DbConn *string DbConn *string
StateConn *string StateConn *string
ResourceConn *string ResourceConn *string
UserConn *string UserConn *string
} }
func NewOverride() *Override { func NewOverride() *Override {
@ -17,10 +17,10 @@ func NewOverride() *Override {
var c string var c string
var d string var d string
o := &Override{ o := &Override{
DbConn: &a, DbConn: &a,
StateConn: &b, StateConn: &b,
ResourceConn: &c, ResourceConn: &c,
UserConn: &d, UserConn: &d,
} }
return o return o
} }

View File

@ -1,14 +1,14 @@
package config package config
import ( import (
"git.grassecon.net/grassrootseconomics/visedriver/env"
viseconfig "git.grassecon.net/grassrootseconomics/visedriver/config"
apiconfig "git.grassecon.net/grassrootseconomics/sarafu-api/config" apiconfig "git.grassecon.net/grassrootseconomics/sarafu-api/config"
viseconfig "git.grassecon.net/grassrootseconomics/visedriver/config"
"git.grassecon.net/grassrootseconomics/visedriver/env"
) )
var ( var (
GetConns = viseconfig.GetConns GetConns = viseconfig.GetConns
EnvPath string EnvPath string
) )
func loadEnv() { func loadEnv() {
@ -20,10 +20,10 @@ func loadEnv() {
} }
const ( const (
defaultSSHHost string = "127.0.0.1" defaultSSHHost string = "127.0.0.1"
defaultSSHPort uint = 7122 defaultSSHPort uint = 7122
defaultHTTPHost string = "127.0.0.1" defaultHTTPHost string = "127.0.0.1"
defaultHTTPPort uint = 7123 defaultHTTPPort uint = 7123
) )
func LoadConfig() error { func LoadConfig() error {

View File

@ -1,11 +1,11 @@
package debug package debug
import ( import (
"fmt"
"encoding/binary" "encoding/binary"
"fmt"
storedb "git.grassecon.net/grassrootseconomics/sarafu-vise/store/db"
visedb "git.defalsify.org/vise.git/db" visedb "git.defalsify.org/vise.git/db"
storedb "git.grassecon.net/grassrootseconomics/sarafu-vise/store/db"
) )
var ( var (
@ -13,10 +13,10 @@ var (
) )
type KeyInfo struct { type KeyInfo struct {
SessionId string SessionId string
Typ uint8 Typ uint8
SubTyp storedb.DataTyp SubTyp storedb.DataTyp
Label string Label string
Description string Description string
} }
@ -53,12 +53,11 @@ func ToKeyInfo(k []byte, sessionId string) (KeyInfo, error) {
k = k[2:] k = k[2:]
} }
return o, nil return o, nil
} }
func subTypToString(v storedb.DataTyp) string { func subTypToString(v storedb.DataTyp) string {
return dbTypStr[v + visedb.DATATYPE_USERDATA + 1] return dbTypStr[v+visedb.DATATYPE_USERDATA+1]
} }
func typToString(v uint8) string { func typToString(v uint8) string {

View File

@ -1,3 +1,4 @@
//go:build debugdb
// +build debugdb // +build debugdb
package debug package debug
@ -11,37 +12,37 @@ import (
func init() { func init() {
DebugCap |= 1 DebugCap |= 1
dbTypStr[db.DATATYPE_STATE] = "internal state" dbTypStr[db.DATATYPE_STATE] = "internal state"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_TRACKING_ID] = "tracking id" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_TRACKING_ID] = "tracking id"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_PUBLIC_KEY] = "public key" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_PUBLIC_KEY] = "public key"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_ACCOUNT_PIN] = "account pin" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_ACCOUNT_PIN] = "account pin"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_FIRST_NAME] = "first name" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_FIRST_NAME] = "first name"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_FAMILY_NAME] = "family name" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_FAMILY_NAME] = "family name"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_YOB] = "year of birth" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_YOB] = "year of birth"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_LOCATION] = "location" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_LOCATION] = "location"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_GENDER] = "gender" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_GENDER] = "gender"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_OFFERINGS] = "offerings" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_OFFERINGS] = "offerings"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_RECIPIENT] = "recipient" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_RECIPIENT] = "recipient"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_AMOUNT] = "amount" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_AMOUNT] = "amount"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_TEMPORARY_VALUE] = "temporary value" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_TEMPORARY_VALUE] = "temporary value"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_ACTIVE_SYM] = "active sym" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_ACTIVE_SYM] = "active sym"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_ACTIVE_BAL] = "active bal" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_ACTIVE_BAL] = "active bal"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_BLOCKED_NUMBER] = "blocked number" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_BLOCKED_NUMBER] = "blocked number"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_PUBLIC_KEY_REVERSE] = "public_key_reverse" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_PUBLIC_KEY_REVERSE] = "public_key_reverse"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_ACTIVE_DECIMAL] = "active decimal" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_ACTIVE_DECIMAL] = "active decimal"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_ACTIVE_ADDRESS] = "active address" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_ACTIVE_ADDRESS] = "active address"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_INCORRECT_PIN_ATTEMPTS] = "incorrect pin attempts" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_INCORRECT_PIN_ATTEMPTS] = "incorrect pin attempts"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_SELECTED_LANGUAGE_CODE] = "selected language" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_SELECTED_LANGUAGE_CODE] = "selected language"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_INITIAL_LANGUAGE_CODE] = "initial language" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_INITIAL_LANGUAGE_CODE] = "initial language"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_VOUCHER_SYMBOLS] = "voucher symbols" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_VOUCHER_SYMBOLS] = "voucher symbols"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_VOUCHER_BALANCES] = "voucher balances" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_VOUCHER_BALANCES] = "voucher balances"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_VOUCHER_DECIMALS] = "voucher decimals" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_VOUCHER_DECIMALS] = "voucher decimals"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_VOUCHER_ADDRESSES] = "voucher addresses" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_VOUCHER_ADDRESSES] = "voucher addresses"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_TX_SENDERS] = "tx senders" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_TX_SENDERS] = "tx senders"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_TX_RECIPIENTS] = "tx recipients" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_TX_RECIPIENTS] = "tx recipients"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_TX_VALUES] = "tx values" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_TX_VALUES] = "tx values"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_TX_ADDRESSES] = "tx addresses" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_TX_ADDRESSES] = "tx addresses"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_TX_HASHES] = "tx hashes" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_TX_HASHES] = "tx hashes"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_TX_DATES] = "tx dates" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_TX_DATES] = "tx dates"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_TX_SYMBOLS] = "tx symbols" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_TX_SYMBOLS] = "tx symbols"
dbTypStr[db.DATATYPE_USERDATA + 1 + storedb.DATA_TX_DECIMALS] = "tx decimals" dbTypStr[db.DATATYPE_USERDATA+1+storedb.DATA_TX_DECIMALS] = "tx decimals"
} }

View File

@ -3,8 +3,8 @@ package debug
import ( import (
"testing" "testing"
storedb "git.grassecon.net/grassrootseconomics/sarafu-vise/store/db"
visedb "git.defalsify.org/vise.git/db" visedb "git.defalsify.org/vise.git/db"
storedb "git.grassecon.net/grassrootseconomics/sarafu-vise/store/db"
) )
func TestDebugDbSubKeyInfo(t *testing.T) { func TestDebugDbSubKeyInfo(t *testing.T) {
@ -24,7 +24,7 @@ func TestDebugDbSubKeyInfo(t *testing.T) {
if r.SubTyp != 2 { if r.SubTyp != 2 {
t.Fatalf("expected 2, got %d", r.SubTyp) t.Fatalf("expected 2, got %d", r.SubTyp)
} }
if DebugCap & 1 > 0 { if DebugCap&1 > 0 {
if r.Label != "tracking id" { if r.Label != "tracking id" {
t.Fatalf("expected 'tracking id', got '%s'", r.Label) t.Fatalf("expected 'tracking id', got '%s'", r.Label)
} }
@ -45,7 +45,7 @@ func TestDebugDbKeyInfo(t *testing.T) {
if r.Typ != 16 { if r.Typ != 16 {
t.Fatalf("expected 16, got %d", r.Typ) t.Fatalf("expected 16, got %d", r.Typ)
} }
if DebugCap & 1 > 0 { if DebugCap&1 > 0 {
if r.Label != "internal state" { if r.Label != "internal state" {
t.Fatalf("expected 'internal_state', got '%s'", r.Label) t.Fatalf("expected 'internal_state', got '%s'", r.Label)
} }
@ -68,7 +68,7 @@ func TestDebugDbKeyInfoRestore(t *testing.T) {
if r.Typ != 32 { if r.Typ != 32 {
t.Fatalf("expected 32, got %d", r.Typ) t.Fatalf("expected 32, got %d", r.Typ)
} }
if DebugCap & 1 > 0 { if DebugCap&1 > 0 {
if r.Label != "active sym" { if r.Label != "active sym" {
t.Fatalf("expected 'active sym', got '%s'", r.Label) t.Fatalf("expected 'active sym', got '%s'", r.Label)
} }

View File

@ -10,14 +10,14 @@ import (
"git.defalsify.org/vise.git/logging" "git.defalsify.org/vise.git/logging"
"git.grassecon.net/grassrootseconomics/sarafu-vise/config" "git.grassecon.net/grassrootseconomics/sarafu-vise/config"
"git.grassecon.net/grassrootseconomics/visedriver/storage"
"git.grassecon.net/grassrootseconomics/sarafu-vise/internal/cmd"
"git.grassecon.net/grassrootseconomics/sarafu-vise/handlers/application" "git.grassecon.net/grassrootseconomics/sarafu-vise/handlers/application"
"git.grassecon.net/grassrootseconomics/sarafu-vise/internal/cmd"
"git.grassecon.net/grassrootseconomics/visedriver/storage"
) )
var ( var (
logg = logging.NewVanilla().WithContextKey("SessionId") logg = logging.NewVanilla().WithContextKey("SessionId")
scriptDir = path.Join("services", "registration") scriptDir = path.Join("services", "registration")
) )
func main() { func main() {

View File

@ -8,18 +8,17 @@ import (
"path" "path"
"strings" "strings"
"git.defalsify.org/vise.git/logging"
"git.defalsify.org/vise.git/lang" "git.defalsify.org/vise.git/lang"
"git.defalsify.org/vise.git/logging"
"git.grassecon.net/grassrootseconomics/visedriver/config" "git.grassecon.net/grassrootseconomics/visedriver/config"
) )
const ( const (
changeHeadSrc = `LOAD reset_account_authorized 0 changeHeadSrc = `LOAD reset_account_authorized 0
LOAD reset_incorrect 0 LOAD reset_incorrect 0
CATCH incorrect_pin flag_incorrect_pin 1 CATCH incorrect_pin flag_incorrect_pin 1
CATCH pin_entry flag_account_authorized 0 CATCH pin_entry flag_account_authorized 0
` `
selectSrc = `LOAD set_language 6 selectSrc = `LOAD set_language 6
RELOAD set_language RELOAD set_language
@ -29,8 +28,8 @@ MOVE language_changed
) )
var ( var (
logg = logging.NewVanilla() logg = logging.NewVanilla()
mouts string mouts string
incmps string incmps string
) )
@ -63,7 +62,7 @@ func main() {
} }
logg.Tracef("using languages", "lang", config.Languages) logg.Tracef("using languages", "lang", config.Languages)
for i, v := range(config.Languages) { for i, v := range config.Languages {
ln, err := lang.LanguageFromCode(v) ln, err := lang.LanguageFromCode(v)
if err != nil { if err != nil {
fmt.Fprintf(os.Stderr, "error parsing language: %s\n", v) fmt.Fprintf(os.Stderr, "error parsing language: %s\n", v)
@ -76,7 +75,7 @@ func main() {
incmps += fmt.Sprintf("INCMP %s %v\n", v, n) incmps += fmt.Sprintf("INCMP %s %v\n", v, n)
p := path.Join(srcDir, v) p := path.Join(srcDir, v)
w, err := os.OpenFile(p, os.O_WRONLY | os.O_CREATE | os.O_EXCL, 0600) w, err := os.OpenFile(p, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0600)
if err != nil { if err != nil {
fmt.Fprintf(os.Stderr, "failed open language set template output: %v\n", err) fmt.Fprintf(os.Stderr, "failed open language set template output: %v\n", err)
os.Exit(1) os.Exit(1)
@ -93,7 +92,7 @@ func main() {
src += "INCMP . *\n" src += "INCMP . *\n"
p := path.Join(srcDir, "select_language.vis") p := path.Join(srcDir, "select_language.vis")
w, err := os.OpenFile(p, os.O_WRONLY | os.O_CREATE | os.O_EXCL, 0600) w, err := os.OpenFile(p, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0600)
if err != nil { if err != nil {
fmt.Fprintf(os.Stderr, "failed open select language vis output: %v\n", err) fmt.Fprintf(os.Stderr, "failed open select language vis output: %v\n", err)
os.Exit(1) os.Exit(1)
@ -107,7 +106,7 @@ func main() {
src = changeHeadSrc + src src = changeHeadSrc + src
p = path.Join(srcDir, "change_language.vis") p = path.Join(srcDir, "change_language.vis")
w, err = os.OpenFile(p, os.O_WRONLY | os.O_CREATE | os.O_EXCL, 0600) w, err = os.OpenFile(p, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0600)
if err != nil { if err != nil {
fmt.Fprintf(os.Stderr, "failed open select language vis output: %v\n", err) fmt.Fprintf(os.Stderr, "failed open select language vis output: %v\n", err)
os.Exit(1) os.Exit(1)

View File

@ -7,11 +7,11 @@ import (
"os" "os"
"path" "path"
"git.grassecon.net/grassrootseconomics/sarafu-vise/config"
"git.grassecon.net/grassrootseconomics/visedriver/storage"
"git.grassecon.net/grassrootseconomics/sarafu-vise/debug"
"git.defalsify.org/vise.git/db" "git.defalsify.org/vise.git/db"
"git.defalsify.org/vise.git/logging" "git.defalsify.org/vise.git/logging"
"git.grassecon.net/grassrootseconomics/sarafu-vise/config"
"git.grassecon.net/grassrootseconomics/sarafu-vise/debug"
"git.grassecon.net/grassrootseconomics/visedriver/storage"
) )
var ( var (

View File

@ -273,7 +273,7 @@ func (h *MenuHandlers) CheckBlockedStatus(ctx context.Context, sym string, input
} }
pinAttemptsValue, _ := strconv.ParseUint(string(currentWrongPinAttempts), 0, 64) pinAttemptsValue, _ := strconv.ParseUint(string(currentWrongPinAttempts), 0, 64)
if pinAttemptsValue == 0 { if pinAttemptsValue == 0 {
res.FlagReset = append(res.FlagReset, flag_account_blocked) res.FlagReset = append(res.FlagReset, flag_account_blocked)
return res, nil return res, nil

View File

@ -35,13 +35,6 @@ func (eu *EventsUpdater) HandleCustodialRegistration(ctx context.Context, ev *ap
if err != nil { if err != nil {
return err return err
} }
// err = pe.Load(identity.SessionId)
// if err != nil {
// return err
// }
// st := pe.GetState()
// st.SetFlag(accountCreatedFlag)
// return pe.Save(identity.SessionId)
logg.DebugCtxf(ctx, "received custodial registration event", "identity", identity) logg.DebugCtxf(ctx, "received custodial registration event", "identity", identity)
return nil return nil
} }

View File

@ -4,12 +4,12 @@ import (
"context" "context"
"fmt" "fmt"
"git.defalsify.org/vise.git/persist"
"git.defalsify.org/vise.git/logging" "git.defalsify.org/vise.git/logging"
"git.grassecon.net/grassrootseconomics/visedriver/storage" "git.defalsify.org/vise.git/persist"
"git.grassecon.net/grassrootseconomics/sarafu-vise/store"
"git.grassecon.net/grassrootseconomics/sarafu-api/remote"
apievent "git.grassecon.net/grassrootseconomics/sarafu-api/event" apievent "git.grassecon.net/grassrootseconomics/sarafu-api/event"
"git.grassecon.net/grassrootseconomics/sarafu-api/remote"
"git.grassecon.net/grassrootseconomics/sarafu-vise/store"
"git.grassecon.net/grassrootseconomics/visedriver/storage"
) )
var ( var (
@ -17,9 +17,9 @@ var (
) )
type EventsUpdater struct { type EventsUpdater struct {
api remote.AccountService api remote.AccountService
formatFunc func(string, int, any) string formatFunc func(string, int, any) string
store storage.StorageService store storage.StorageService
} }
func NewEventsUpdater(api remote.AccountService, store storage.StorageService) *EventsUpdater { func NewEventsUpdater(api remote.AccountService, store storage.StorageService) *EventsUpdater {

View File

@ -6,13 +6,13 @@ import (
"strings" "strings"
"git.defalsify.org/vise.git/db" "git.defalsify.org/vise.git/db"
"git.grassecon.net/grassrootseconomics/sarafu-vise/store"
storedb "git.grassecon.net/grassrootseconomics/sarafu-vise/store/db"
"git.grassecon.net/grassrootseconomics/common/identity" "git.grassecon.net/grassrootseconomics/common/identity"
apievent "git.grassecon.net/grassrootseconomics/sarafu-api/event" apievent "git.grassecon.net/grassrootseconomics/sarafu-api/event"
"git.grassecon.net/grassrootseconomics/sarafu-vise/store"
storedb "git.grassecon.net/grassrootseconomics/sarafu-vise/store/db"
) )
// execute all // execute all
func (eu *EventsUpdater) updateToken(ctx context.Context, identity identity.Identity, userStore *store.UserDataStore, tokenAddress string) error { func (eu *EventsUpdater) updateToken(ctx context.Context, identity identity.Identity, userStore *store.UserDataStore, tokenAddress string) error {
err := eu.updateTokenList(ctx, identity, userStore) err := eu.updateTokenList(ctx, identity, userStore)
if err != nil { if err != nil {
@ -47,7 +47,6 @@ func (eu *EventsUpdater) updateToken(ctx context.Context, identity identity.Iden
return nil return nil
} }
// set default token to given symbol. // set default token to given symbol.
func (eu *EventsUpdater) updateDefaultToken(ctx context.Context, identity identity.Identity, userStore *store.UserDataStore, activeSym string) error { func (eu *EventsUpdater) updateDefaultToken(ctx context.Context, identity identity.Identity, userStore *store.UserDataStore, activeSym string) error {
pfxDb := toPrefixDb(userStore, identity.SessionId) pfxDb := toPrefixDb(userStore, identity.SessionId)
@ -59,7 +58,6 @@ func (eu *EventsUpdater) updateDefaultToken(ctx context.Context, identity identi
return store.UpdateVoucherData(ctx, userStore, identity.SessionId, tokenData) return store.UpdateVoucherData(ctx, userStore, identity.SessionId, tokenData)
} }
// handle token transfer. // handle token transfer.
// //
// if from and to are NOT the same, handle code will be executed once for each side of the transfer. // if from and to are NOT the same, handle code will be executed once for each side of the transfer.
@ -189,7 +187,7 @@ func (eu *EventsUpdater) updateTokenTransferList(ctx context.Context, identity i
return err return err
} }
for i, tx := range(txs) { for i, tx := range txs {
r = append(r, eu.formatFunc(apievent.EventTokenTransferTag, i, tx)) r = append(r, eu.formatFunc(apievent.EventTokenTransferTag, i, tx))
} }

View File

@ -5,8 +5,8 @@ import (
"fmt" "fmt"
"git.defalsify.org/vise.git/logging" "git.defalsify.org/vise.git/logging"
"git.grassecon.net/grassrootseconomics/visedriver/storage"
"git.grassecon.net/grassrootseconomics/sarafu-vise/handlers/application" "git.grassecon.net/grassrootseconomics/sarafu-vise/handlers/application"
"git.grassecon.net/grassrootseconomics/visedriver/storage"
) )
var ( var (
@ -14,17 +14,17 @@ var (
) )
type Cmd struct { type Cmd struct {
sessionId string sessionId string
conn storage.ConnData conn storage.ConnData
flagParser *application.FlagManager flagParser *application.FlagManager
cmd int cmd int
enable bool enable bool
exec func(ctx context.Context, ss storage.StorageService) error exec func(ctx context.Context, ss storage.StorageService) error
} }
func NewCmd(sessionId string, flagParser *application.FlagManager) *Cmd { func NewCmd(sessionId string, flagParser *application.FlagManager) *Cmd {
return &Cmd{ return &Cmd{
sessionId: sessionId, sessionId: sessionId,
flagParser: flagParser, flagParser: flagParser,
} }
} }
@ -94,5 +94,3 @@ func (c *Cmd) Parse(args []string) error {
return fmt.Errorf("unknown subcommand: %s", cmd) return fmt.Errorf("unknown subcommand: %s", cmd)
} }

View File

@ -9,14 +9,14 @@ import (
"regexp" "regexp"
"testing" "testing"
"github.com/gofrs/uuid"
"git.defalsify.org/vise.git/logging" "git.defalsify.org/vise.git/logging"
"git.grassecon.net/grassrootseconomics/visedriver/testutil/driver"
"git.grassecon.net/grassrootseconomics/sarafu-vise/testutil" "git.grassecon.net/grassrootseconomics/sarafu-vise/testutil"
"git.grassecon.net/grassrootseconomics/visedriver/testutil/driver"
"github.com/gofrs/uuid"
) )
var ( var (
logg = logging.NewVanilla().WithDomain("menutraversaltest") logg = logging.NewVanilla().WithDomain("menutraversaltest")
testData = driver.ReadData() testData = driver.ReadData()
sessionID string sessionID string
src = rand.NewSource(42) src = rand.NewSource(42)

View File

@ -12,7 +12,7 @@ func (p *Profile) InsertOrShift(index int, value string) {
for len(p.ProfileItems) < index { for len(p.ProfileItems) < index {
p.ProfileItems = append(p.ProfileItems, "0") p.ProfileItems = append(p.ProfileItems, "0")
} }
p.ProfileItems = append(p.ProfileItems, "0") p.ProfileItems = append(p.ProfileItems, "0")
p.ProfileItems[index] = value p.ProfileItems[index] = value
} }
} }

View File

@ -1,16 +1,17 @@
//go:build !online
// +build !online // +build !online
package services package services
import ( import (
"fmt"
"context" "context"
"fmt"
"git.grassecon.net/grassrootseconomics/visedriver/storage"
devremote "git.grassecon.net/grassrootseconomics/sarafu-api/dev" devremote "git.grassecon.net/grassrootseconomics/sarafu-api/dev"
"git.grassecon.net/grassrootseconomics/sarafu-api/remote"
apievent "git.grassecon.net/grassrootseconomics/sarafu-api/event" apievent "git.grassecon.net/grassrootseconomics/sarafu-api/event"
"git.grassecon.net/grassrootseconomics/sarafu-api/remote"
"git.grassecon.net/grassrootseconomics/sarafu-vise/handlers/event" "git.grassecon.net/grassrootseconomics/sarafu-vise/handlers/event"
"git.grassecon.net/grassrootseconomics/visedriver/storage"
) )
type localEmitter struct { type localEmitter struct {

View File

@ -1,3 +1,4 @@
//go:build online
// +build online // +build online
package services package services
@ -5,9 +6,9 @@ package services
import ( import (
"context" "context"
"git.grassecon.net/grassrootseconomics/visedriver/storage"
"git.grassecon.net/grassrootseconomics/sarafu-api/remote" "git.grassecon.net/grassrootseconomics/sarafu-api/remote"
httpremote "git.grassecon.net/grassrootseconomics/sarafu-api/remote/http" httpremote "git.grassecon.net/grassrootseconomics/sarafu-api/remote/http"
"git.grassecon.net/grassrootseconomics/visedriver/storage"
) )
func New(ctx context.Context, storageService storage.StorageService, conn storage.ConnData) remote.AccountService { func New(ctx context.Context, storageService storage.StorageService, conn storage.ConnData) remote.AccountService {

View File

@ -29,7 +29,7 @@ func NewSshKeyStore(ctx context.Context, dbDir string) (*SshKeyStore, error) {
return keyStore, nil return keyStore, nil
} }
func(s *SshKeyStore) AddFromFile(ctx context.Context, fp string, sessionId string) error { func (s *SshKeyStore) AddFromFile(ctx context.Context, fp string, sessionId string) error {
_, err := os.Stat(fp) _, err := os.Stat(fp)
if err != nil { if err != nil {
return fmt.Errorf("cannot open ssh server public key file: %v\n", err) return fmt.Errorf("cannot open ssh server public key file: %v\n", err)
@ -51,7 +51,7 @@ func(s *SshKeyStore) AddFromFile(ctx context.Context, fp string, sessionId strin
return s.store.Put(ctx, k, []byte(sessionId)) return s.store.Put(ctx, k, []byte(sessionId))
} }
func(s *SshKeyStore) Get(ctx context.Context, pubKey ssh.PublicKey) (string, error) { func (s *SshKeyStore) Get(ctx context.Context, pubKey ssh.PublicKey) (string, error) {
s.store.SetLanguage(nil) s.store.SetLanguage(nil)
s.store.SetSession("") s.store.SetSession("")
s.store.SetPrefix(storage.DATATYPE_EXTEND) s.store.SetPrefix(storage.DATATYPE_EXTEND)
@ -63,6 +63,6 @@ func(s *SshKeyStore) Get(ctx context.Context, pubKey ssh.PublicKey) (string, err
return string(v), nil return string(v), nil
} }
func(s *SshKeyStore) Close(ctx context.Context) error { func (s *SshKeyStore) Close(ctx context.Context) error {
return s.store.Close(ctx) return s.store.Close(ctx)
} }

View File

@ -2,8 +2,8 @@ package ssh
import ( import (
"context" "context"
"encoding/hex"
"encoding/base64" "encoding/base64"
"encoding/hex"
"errors" "errors"
"fmt" "fmt"
"net" "net"
@ -16,9 +16,9 @@ import (
"git.defalsify.org/vise.git/logging" "git.defalsify.org/vise.git/logging"
"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/sarafu-vise/services"
"git.grassecon.net/grassrootseconomics/sarafu-vise/handlers" "git.grassecon.net/grassrootseconomics/sarafu-vise/handlers"
"git.grassecon.net/grassrootseconomics/sarafu-vise/services"
"git.grassecon.net/grassrootseconomics/visedriver/storage"
) )
var ( var (
@ -26,32 +26,32 @@ var (
) )
type auther struct { type auther struct {
Ctx context.Context Ctx context.Context
keyStore *SshKeyStore keyStore *SshKeyStore
auth map[string]string auth map[string]string
} }
func NewAuther(ctx context.Context, keyStore *SshKeyStore) *auther { func NewAuther(ctx context.Context, keyStore *SshKeyStore) *auther {
return &auther{ return &auther{
Ctx: ctx, Ctx: ctx,
keyStore: keyStore, keyStore: keyStore,
auth: make(map[string]string), auth: make(map[string]string),
} }
} }
func(a *auther) Check(conn ssh.ConnMetadata, pubKey ssh.PublicKey) (*ssh.Permissions, error) { func (a *auther) Check(conn ssh.ConnMetadata, pubKey ssh.PublicKey) (*ssh.Permissions, error) {
logg.TraceCtxf(a.Ctx, "looking for publickey", "pubkey", fmt.Sprintf("%x", pubKey)) logg.TraceCtxf(a.Ctx, "looking for publickey", "pubkey", fmt.Sprintf("%x", pubKey))
va, err := a.keyStore.Get(a.Ctx, pubKey) va, err := a.keyStore.Get(a.Ctx, pubKey)
if err != nil { if err != nil {
return nil, err return nil, err
} }
ka := hex.EncodeToString(conn.SessionID()) ka := hex.EncodeToString(conn.SessionID())
a.auth[ka] = va a.auth[ka] = va
fmt.Fprintf(os.Stderr, "connect: %s -> %s\n", ka, va) fmt.Fprintf(os.Stderr, "connect: %s -> %s\n", ka, va)
return nil, nil return nil, nil
} }
func(a *auther) FromConn(c *ssh.ServerConn) (string, error) { func (a *auther) FromConn(c *ssh.ServerConn) (string, error) {
if c == nil { if c == nil {
return "", errors.New("nil server conn") return "", errors.New("nil server conn")
} }
@ -61,8 +61,7 @@ func(a *auther) FromConn(c *ssh.ServerConn) (string, error) {
return a.Get(c.Conn.SessionID()) return a.Get(c.Conn.SessionID())
} }
func (a *auther) Get(k []byte) (string, error) {
func(a *auther) Get(k []byte) (string, error) {
ka := hex.EncodeToString(k) ka := hex.EncodeToString(k)
v, ok := a.auth[ka] v, ok := a.auth[ka]
if !ok { if !ok {
@ -72,19 +71,19 @@ func(a *auther) Get(k []byte) (string, error) {
} }
type SshRunner struct { type SshRunner struct {
Ctx context.Context Ctx context.Context
Cfg engine.Config Cfg engine.Config
FlagFile string FlagFile string
Conn storage.Conns Conn storage.Conns
Debug bool Debug bool
SrvKeyFile string SrvKeyFile string
Host string Host string
Port uint Port uint
wg sync.WaitGroup wg sync.WaitGroup
lst net.Listener lst net.Listener
} }
func(s *SshRunner) serve(ctx context.Context, sessionId string, ch ssh.NewChannel, en engine.Engine) error { func (s *SshRunner) serve(ctx context.Context, sessionId string, ch ssh.NewChannel, en engine.Engine) error {
if ch == nil { if ch == nil {
return errors.New("nil channel") return errors.New("nil channel")
} }
@ -101,7 +100,7 @@ func(s *SshRunner) serve(ctx context.Context, sessionId string, ch ssh.NewChanne
go func(reqIn <-chan *ssh.Request) { go func(reqIn <-chan *ssh.Request) {
defer s.wg.Done() defer s.wg.Done()
for req := range reqIn { for req := range reqIn {
req.Reply(req.Type == "shell", nil) req.Reply(req.Type == "shell", nil)
} }
_ = requests _ = requests
}(requests) }(requests)
@ -141,11 +140,11 @@ func(s *SshRunner) serve(ctx context.Context, sessionId string, ch ssh.NewChanne
return nil return nil
} }
func(s *SshRunner) Stop() error { func (s *SshRunner) Stop() error {
return s.lst.Close() return s.lst.Close()
} }
func(s *SshRunner) GetEngine(sessionId string) (engine.Engine, func(), error) { func (s *SshRunner) GetEngine(sessionId string) (engine.Engine, func(), error) {
ctx := s.Ctx ctx := s.Ctx
menuStorageService := storage.NewMenuStorageService(s.Conn) menuStorageService := storage.NewMenuStorageService(s.Conn)
@ -202,7 +201,7 @@ func(s *SshRunner) GetEngine(sessionId string) (engine.Engine, func(), error) {
} }
// adapted example from crypto/ssh package, NewServerConn doc // adapted example from crypto/ssh package, NewServerConn doc
func(s *SshRunner) Run(ctx context.Context, keyStore *SshKeyStore) { func (s *SshRunner) Run(ctx context.Context, keyStore *SshKeyStore) {
s.Ctx = ctx s.Ctx = ctx
running := true running := true
@ -255,7 +254,7 @@ func(s *SshRunner) Run(ctx context.Context, keyStore *SshKeyStore) {
ssh.DiscardRequests(rC) ssh.DiscardRequests(rC)
s.wg.Done() s.wg.Done()
}() }()
sessionId, err := auth.FromConn(srvConn) sessionId, err := auth.FromConn(srvConn)
if err != nil { if err != nil {
logg.ErrorCtxf(ctx, "Cannot find authentication") logg.ErrorCtxf(ctx, "Cannot find authentication")

View File

@ -3,8 +3,8 @@ package store
import ( import (
"testing" "testing"
"github.com/alecthomas/assert/v2"
storedb "git.grassecon.net/grassrootseconomics/sarafu-vise/store/db" storedb "git.grassecon.net/grassrootseconomics/sarafu-vise/store/db"
"github.com/alecthomas/assert/v2"
) )
func TestParseAndScaleAmount(t *testing.T) { func TestParseAndScaleAmount(t *testing.T) {

View File

@ -4,10 +4,10 @@ import (
"context" "context"
visedb "git.defalsify.org/vise.git/db" visedb "git.defalsify.org/vise.git/db"
storedb "git.grassecon.net/grassrootseconomics/sarafu-vise/store/db"
"git.grassecon.net/grassrootseconomics/sarafu-vise/store/db"
"git.grassecon.net/grassrootseconomics/common/hex" "git.grassecon.net/grassrootseconomics/common/hex"
"git.grassecon.net/grassrootseconomics/common/identity" "git.grassecon.net/grassrootseconomics/common/identity"
"git.grassecon.net/grassrootseconomics/sarafu-vise/store/db"
storedb "git.grassecon.net/grassrootseconomics/sarafu-vise/store/db"
) )
// TODO: Rename interface, "datastore" is redundant naming and too general // TODO: Rename interface, "datastore" is redundant naming and too general

View File

@ -9,24 +9,24 @@ import (
"path/filepath" "path/filepath"
"time" "time"
"github.com/jackc/pgx/v5/pgxpool"
"git.defalsify.org/vise.git/engine" "git.defalsify.org/vise.git/engine"
"git.defalsify.org/vise.git/resource" "git.defalsify.org/vise.git/resource"
"git.grassecon.net/grassrootseconomics/sarafu-vise/config"
"git.grassecon.net/grassrootseconomics/sarafu-vise/handlers"
"git.grassecon.net/grassrootseconomics/visedriver/storage"
"git.grassecon.net/grassrootseconomics/sarafu-api/testutil/testservice"
"git.grassecon.net/grassrootseconomics/sarafu-api/remote" "git.grassecon.net/grassrootseconomics/sarafu-api/remote"
httpremote "git.grassecon.net/grassrootseconomics/sarafu-api/remote/http" httpremote "git.grassecon.net/grassrootseconomics/sarafu-api/remote/http"
"git.grassecon.net/grassrootseconomics/sarafu-api/testutil/testservice"
"git.grassecon.net/grassrootseconomics/sarafu-vise/config"
"git.grassecon.net/grassrootseconomics/sarafu-vise/handlers"
"git.grassecon.net/grassrootseconomics/sarafu-vise/testutil/testtag" "git.grassecon.net/grassrootseconomics/sarafu-vise/testutil/testtag"
"git.grassecon.net/grassrootseconomics/visedriver/storage"
"github.com/jackc/pgx/v5/pgxpool"
) )
// CleanDatabase removes all test data from the database // CleanDatabase removes all test data from the database
func CleanDatabase() { func CleanDatabase() {
for _, v := range([]int8{ for _, v := range []int8{
storage.STORETYPE_STATE, storage.STORETYPE_STATE,
storage.STORETYPE_USER, storage.STORETYPE_USER,
}) { } {
conn := conns[v] conn := conns[v]
logg.Infof("cleaning test database", "typ", v, "db", conn) logg.Infof("cleaning test database", "typ", v, "db", conn)
if conn.DbType() == storage.DBTYPE_POSTGRES { if conn.DbType() == storage.DBTYPE_POSTGRES {

View File

@ -1,10 +1,10 @@
//go:build testfsdb
// +build testfsdb // +build testfsdb
package testutil package testutil
import ( import (
"os" "os"
) )
const ( const (

View File

@ -1,10 +1,11 @@
//go:build testgdbmdb
// +build testgdbmdb // +build testgdbmdb
package testutil package testutil
import ( import (
"os"
"net/url" "net/url"
"os"
) )
const ( const (

View File

@ -4,21 +4,21 @@ import (
"context" "context"
"path" "path"
testdataloader "github.com/peteole/testdata-loader"
"git.defalsify.org/vise.git/logging"
fsdb "git.defalsify.org/vise.git/db/fs"
"git.defalsify.org/vise.git/db" "git.defalsify.org/vise.git/db"
"git.grassecon.net/grassrootseconomics/visedriver/storage" fsdb "git.defalsify.org/vise.git/db/fs"
"git.defalsify.org/vise.git/logging"
"git.grassecon.net/grassrootseconomics/sarafu-vise/config" "git.grassecon.net/grassrootseconomics/sarafu-vise/config"
"git.grassecon.net/grassrootseconomics/visedriver/storage"
testdataloader "github.com/peteole/testdata-loader"
) )
var ( var (
logg = logging.NewVanilla().WithDomain("sarafu-vise.testutil").WithContextKey("SessionId") logg = logging.NewVanilla().WithDomain("sarafu-vise.testutil").WithContextKey("SessionId")
conns storage.Conns conns storage.Conns
resourceDb db.Db resourceDb db.Db
baseDir = testdataloader.GetBasePath() baseDir = testdataloader.GetBasePath()
scriptDir = path.Join(baseDir, "services", "registration") scriptDir = path.Join(baseDir, "services", "registration")
override config.Override override config.Override
) )
func init() { func init() {

View File

@ -1,3 +1,4 @@
//go:build !online
// +build !online // +build !online
package testtag package testtag

View File

@ -1,3 +1,4 @@
//go:build online
// +build online // +build online
package testtag package testtag