Skip to content

Commit 91a7a2e

Browse files
committed
added src
1 parent 79dd7a9 commit 91a7a2e

File tree

2,078 files changed

+4641579
-149
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,078 files changed

+4641579
-149
lines changed

cli.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package main
2+
3+
import "groundup/cmd"
4+
5+
func main() {
6+
cmd.Execute()
7+
}

cli/cliutility/cliutility.go

Lines changed: 0 additions & 45 deletions
This file was deleted.

cliutility/cliutility.go

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
package cliutility
2+
3+
import (
4+
"fmt"
5+
"log"
6+
"os"
7+
"text/template"
8+
9+
. "github.com/golangast/groundup/src/dashboard/generator/generatorutility"
10+
. "github.com/golangast/groundup/src/dashboard/ut"
11+
12+
. "github.com/golangast/groundup/src/dashboard/generator/templates/db/dbconn"
13+
. "github.com/golangast/groundup/src/dashboard/generator/templates/db/getdata"
14+
)
15+
16+
func isError(err error) bool {
17+
if err != nil {
18+
fmt.Println(err.Error())
19+
}
20+
21+
return (err != nil)
22+
}
23+
24+
//creates the config folder/file
25+
func CreateConfig() {
26+
27+
if err := os.MkdirAll("config", os.ModeSticky|os.ModePerm); err != nil {
28+
fmt.Println("Directory(ies) successfully created with sticky bits and full permissions")
29+
} else {
30+
fmt.Println("Whoops, could not create directory(ies) because", err)
31+
}
32+
33+
mfile, err := os.Create("config/persis.yaml")
34+
if isError(err) {
35+
fmt.Println("error -", err, mfile)
36+
}
37+
var Configbase = `
38+
app:
39+
app: "app.go"
40+
path: "app"
41+
file: "home.html"
42+
script: "jquery"`
43+
/* write to the files */
44+
tm := template.Must(template.New("queue").Parse(Configbase))
45+
err = tm.Execute(mfile, nil)
46+
if err != nil {
47+
log.Print("execute: ", err)
48+
return
49+
}
50+
defer mfile.Close()
51+
}
52+
53+
func Gendatabase(p string) {
54+
//make folder
55+
Makefolder(p)
56+
Makefolder(p + "/getdata")
57+
58+
//make file/database
59+
Makefile(p + "/database.db")
60+
gdatafile := Makefile(p + "/getdata/getdata.go")
61+
dbfile := Makefile(p + "/db.go")
62+
63+
//add database connections to server file
64+
AddDB("app/app.go", Grabdatatemp)
65+
66+
//show data on html template file
67+
//Showdata("app/templates/newpage.html")
68+
69+
//write it to the file
70+
Writetemplate(Dbconntemp, dbfile, nil)
71+
Writetemplate(Getdatatemp, gdatafile, nil)
72+
73+
//pull down dependencies
74+
PullDowndb("app")
75+
Pulldowneverythingbase("app")
76+
err, out, errout := Shellout(`cd app && go mod tidy && go mod vendor`)
77+
if err != nil {
78+
log.Printf("error: %v\n", err)
79+
}
80+
fmt.Println(out)
81+
fmt.Println("--- errs ---")
82+
fmt.Println(errout)
83+
84+
}

cli/cmd/config.go renamed to cmd/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
"github.com/spf13/cobra"
1010

11-
. "github.com/golangast/groundup/cli/cliutility"
11+
. "github.com/golangast/groundup/src/cliutility"
1212
)
1313

1414
// configCmd represents the config command

cli/cmd/db.go renamed to cmd/db.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ package cmd
77
import (
88
"fmt"
99

10-
. "github.com/golangast/groundup/dashboard/generator/gen/gendatabase/createdatabase"
10+
. "github.com/golangast/groundup/src/cliutility"
11+
1112
"github.com/spf13/cobra"
1213
)
1314

File renamed without changes.

cli/cmd/server.go renamed to cmd/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package cmd
77
import (
88
"fmt"
99

10-
. "github.com/golangast/groundup/dashboard/generator/gen/genserver"
10+
. "github.com/golangast/groundup/src/dashboard/generator/gen/genserver"
1111

1212
"github.com/spf13/cobra"
1313
)

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/golangast/groundup
2+
3+
go 1.18

src/dashboard/dbsql/appdata/addappdatabase/addappdatabase.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package addappdatabase
22

33
import (
4-
. "github.com/golangast/groundup/dashboard/dbsql/conn"
4+
. "github.com/golangast/groundup/src/dashboard/dbsql/conn"
55
)
66

77
func Addappdatabase() {

src/dashboard/dbsql/appdata/getapptablenames/getapptablenames.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package getapptabledata
33
import (
44
"fmt"
55

6-
. "github.com/golangast/groundup/dashboard/dbsql/conn"
6+
. "github.com/golangast/groundup/src/dashboard/dbsql/conn"
77
)
88

99
//just get the table names

src/dashboard/dbsql/appdata/getapptables/getapptables.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package getapptables
33
import (
44
"fmt"
55

6-
. "github.com/golangast/groundup/dashboard/dbsql/conn"
6+
. "github.com/golangast/groundup/src/dashboard/dbsql/conn"
77
)
88

99
type TableData struct {

src/dashboard/dbsql/conn/conn.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"os"
88
"time"
99

10-
. "github.com/golangast/groundup/dashboard/generator/generatorutility"
10+
. "github.com/golangast/groundup/src/dashboard/generator/generatorutility"
1111

1212
_ "modernc.org/sqlite"
1313
)

src/dashboard/dbsql/createdb/createdb.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"os"
66

7-
. "github.com/golangast/groundup/dashboard/dbsql/conn"
7+
. "github.com/golangast/groundup/src/dashboard/dbsql/conn"
88
)
99

1010
func CreateDB() {

src/dashboard/dbsql/datacreation/savedbtables/savedbtables.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"log"
66

7-
. "github.com/golangast/groundup/dashboard/dbsql/conn"
7+
. "github.com/golangast/groundup/src/dashboard/dbsql/conn"
88
)
99

1010
//saves the table in the dashboard only

src/dashboard/dbsql/datacreation/savejslib/savejslib.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"log"
66

7-
. "github.com/golangast/groundup/dashboard/dbsql/conn"
7+
. "github.com/golangast/groundup/src/dashboard/dbsql/conn"
88
)
99

1010
func Addsavedata(lib, libtag string) {

src/dashboard/dbsql/deletetable/deletetable.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package deletetable
33
import (
44
"fmt"
55

6-
. "github.com/golangast/groundup/dashboard/dbsql/conn"
6+
. "github.com/golangast/groundup/src/dashboard/dbsql/conn"
77
)
88

99
func Deletetable(table string) error {

src/dashboard/dbsql/gettabledata/gettabledata.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package gettabledata
33
import (
44
"fmt"
55

6-
. "github.com/golangast/groundup/dashboard/dbsql/conn"
6+
. "github.com/golangast/groundup/src/dashboard/dbsql/conn"
77
)
88

99
func Gettabledata() []DBFields {

src/dashboard/dbsql/pagecreation/addlibtag/addlibtag.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66
"log"
77

8-
. "github.com/golangast/groundup/dashboard/dbsql/conn"
8+
. "github.com/golangast/groundup/src/dashboard/dbsql/conn"
99
)
1010

1111
func UpdateUrls(lib, tag, titles string) {
@@ -99,5 +99,3 @@ type Urls struct {
9999
Csstag string `param:"csstag" query:"csstag" form:"csstag"`
100100
Filename string `param:"filename" query:"filename" form:"filename"`
101101
}
102-
103-

src/dashboard/dbsql/pagecreation/addurltitle/addurltitle.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"log"
66

7-
. "github.com/golangast/groundup/dashboard/dbsql/conn"
7+
. "github.com/golangast/groundup/src/dashboard/dbsql/conn"
88
)
99

1010
func AddUrlTitle(u Urls) {
@@ -50,5 +50,3 @@ type Urls struct {
5050
Csstag string `param:"csstag" query:"csstag" form:"csstag"`
5151
Filename string `param:"filename" query:"filename" form:"filename"`
5252
}
53-
54-

src/dashboard/dbsql/pagecreation/deletebytitle/deletebytitle.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package deletebytitle
33
import (
44
"errors"
55

6-
. "github.com/golangast/groundup/dashboard/dbsql/conn"
6+
. "github.com/golangast/groundup/src/dashboard/dbsql/conn"
77
)
88

99
func Deletebytitle(titles string) error {

src/dashboard/dbsql/pagecreation/deletebyurl/deletebyurl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package deletebyurl
33
import (
44
"errors"
55

6-
. "github.com/golangast/groundup/dashboard/dbsql/conn"
6+
. "github.com/golangast/groundup/src/dashboard/dbsql/conn"
77
)
88

99
func Deletebyurl(urls string) error {

src/dashboard/dbsql/pagecreation/getallcss/getallcss.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package getallcss
33
import (
44
"fmt"
55

6-
. "github.com/golangast/groundup/dashboard/dbsql/conn"
6+
. "github.com/golangast/groundup/src/dashboard/dbsql/conn"
77
)
88

99
func Getallcss() []CSS {

src/dashboard/dbsql/pagecreation/getallurls/getallurls.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package geturls
33
import (
44
"fmt"
55

6-
. "github.com/golangast/groundup/dashboard/dbsql/conn"
6+
. "github.com/golangast/groundup/src/dashboard/dbsql/conn"
77
)
88

99
func GetUrls() []Urls {

src/dashboard/dbsql/pagecreation/getlib/getlib.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"log"
66

7-
. "github.com/golangast/groundup/dashboard/dbsql/conn"
7+
. "github.com/golangast/groundup/src/dashboard/dbsql/conn"
88
)
99

1010
func GetLib(Libtag string) string {

src/dashboard/dbsql/pagecreation/getnav/getnav.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package getnav
33
import (
44
"fmt"
55

6-
. "github.com/golangast/groundup/dashboard/dbsql/conn"
6+
. "github.com/golangast/groundup/src/dashboard/dbsql/conn"
77
)
88

99
func Getnav() []Nav {
@@ -60,4 +60,3 @@ type Nav struct {
6060
I string `param:"i" query:"i" form:"i"`
6161
J string `param:"j" query:"j" form:"j"`
6262
}
63-

src/dashboard/dbsql/pagecreation/getpage/getpage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"log"
66

7-
. "github.com/golangast/groundup/dashboard/dbsql/conn"
7+
. "github.com/golangast/groundup/src/dashboard/dbsql/conn"
88
)
99

1010
func GetPage() ([]string, []string) {

src/dashboard/generator/gen/gendatabase/createdatabase/gendatabase.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import (
44
"fmt"
55
"log"
66

7-
. "github.com/golangast/groundup/dashboard/generator/generatorutility"
8-
. "github.com/golangast/groundup/dashboard/ut"
7+
. "github.com/golangast/groundup/src/dashboard/generator/generatorutility"
8+
. "github.com/golangast/groundup/src/dashboard/ut"
99

10-
. "github.com/golangast/groundup/dashboard/generator/templates/db/dbconn"
11-
. "github.com/golangast/groundup/dashboard/generator/templates/db/getdata"
10+
. "github.com/golangast/groundup/src/dashboard/generator/templates/db/dbconn"
11+
. "github.com/golangast/groundup/src/dashboard/generator/templates/db/getdata"
1212
)
1313

1414
func Gendatabase(p string) {

src/dashboard/generator/gen/gendatabase/dashcreatetable/dashcreatetable.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import (
44
"os"
55
"reflect"
66

7-
. "github.com/golangast/groundup/dashboard/dbsql/conn"
8-
. "github.com/golangast/groundup/dashboard/generator/generatorutility"
9-
. "github.com/golangast/groundup/dashboard/generator/templates/db/createdb"
10-
. "github.com/golangast/groundup/dashboard/ut"
7+
. "github.com/golangast/groundup/src/dashboard/dbsql/conn"
8+
. "github.com/golangast/groundup/src/dashboard/generator/generatorutility"
9+
. "github.com/golangast/groundup/src/dashboard/generator/templates/db/createdb"
10+
. "github.com/golangast/groundup/src/dashboard/ut"
1111
)
1212

1313
//creates database and files in the app

src/dashboard/generator/gen/genserver/genserver.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import (
44
"fmt"
55
"os"
66

7-
. "github.com/golangast/groundup/dashboard/dbsql/conn"
8-
. "github.com/golangast/groundup/dashboard/generator/generatorutility"
9-
. "github.com/golangast/groundup/dashboard/generator/templates/body"
10-
. "github.com/golangast/groundup/dashboard/generator/templates/footer"
11-
. "github.com/golangast/groundup/dashboard/generator/templates/header"
12-
. "github.com/golangast/groundup/dashboard/generator/templates/server"
7+
. "github.com/golangast/groundup/src/dashboard/dbsql/conn"
8+
. "github.com/golangast/groundup/src/dashboard/generator/generatorutility"
9+
. "github.com/golangast/groundup/src/dashboard/generator/templates/body"
10+
. "github.com/golangast/groundup/src/dashboard/generator/templates/footer"
11+
. "github.com/golangast/groundup/src/dashboard/generator/templates/header"
12+
. "github.com/golangast/groundup/src/dashboard/generator/templates/server"
1313
"github.com/spf13/viper"
1414
)
1515

0 commit comments

Comments
 (0)