Skip to content

Commit

Permalink
docs(docs): update example
Browse files Browse the repository at this point in the history
  • Loading branch information
cg33 committed Apr 13, 2020
1 parent d1c9654 commit 6d445c5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions example/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ go 1.14

require (
github.com/GoAdminGroup/filemanager v0.0.0-20200413035633-22b491a688de
github.com/GoAdminGroup/go-admin v1.2.8-0.20200412164441-ecd28c80fccb
github.com/GoAdminGroup/themes v0.0.30-0.20200413000940-c9ef15db4348
github.com/GoAdminGroup/go-admin v1.2.8
github.com/GoAdminGroup/themes v0.0.30
github.com/gin-gonic/gin v1.6.2
github.com/h2non/filetype v1.0.12 // indirect
github.com/smartystreets/goconvey v1.6.4 // indirect
Expand Down
4 changes: 4 additions & 0 deletions example/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ github.com/GoAdminGroup/filemanager v0.0.0-20200413035633-22b491a688de h1:oSprtO
github.com/GoAdminGroup/filemanager v0.0.0-20200413035633-22b491a688de/go.mod h1:H3161Jm5n7HkUI7AAr9TJYpuxkLN5PrdQXe+4FMoOq4=
github.com/GoAdminGroup/go-admin v1.2.8-0.20200412164441-ecd28c80fccb h1:rh0LUbsIbj6ZIAzbblKzgXz/y47wp/TZnjFLY2tyXcQ=
github.com/GoAdminGroup/go-admin v1.2.8-0.20200412164441-ecd28c80fccb/go.mod h1:9Kk8rbrMUUiKQCRaAtdV1aHOTHaqzeyjChq9ykQ76Rg=
github.com/GoAdminGroup/go-admin v1.2.8 h1:Hub/J6LnsUDJc3EEkK7RQX+RReE7cQTX7b8d3RlPl3Q=
github.com/GoAdminGroup/go-admin v1.2.8/go.mod h1:9Kk8rbrMUUiKQCRaAtdV1aHOTHaqzeyjChq9ykQ76Rg=
github.com/GoAdminGroup/html v0.0.1 h1:SdWNWl4OKPsvDk2GDp5ZKD6ceWoN8n4Pj6cUYxavUd0=
github.com/GoAdminGroup/html v0.0.1/go.mod h1:A1laTJaOx8sQ64p2dE8IqtstDeCNBHEazrEp7hR5VvM=
github.com/GoAdminGroup/themes v0.0.30-0.20200412131615-60d8ce976795 h1:S1yhf3iarFODRBN6XqjW97HFmuqh8nFSA9krYH2unjY=
github.com/GoAdminGroup/themes v0.0.30-0.20200412131615-60d8ce976795/go.mod h1:ABCOeBeibfg9DxAsGVa1NzYK9/nIbHT/BuFrCRIKo8A=
github.com/GoAdminGroup/themes v0.0.30-0.20200413000940-c9ef15db4348 h1:svCyXLG0TJjUv6o9BV+fE3Vq4oEXHGvH/MWS9j4/x+o=
github.com/GoAdminGroup/themes v0.0.30-0.20200413000940-c9ef15db4348/go.mod h1:ABCOeBeibfg9DxAsGVa1NzYK9/nIbHT/BuFrCRIKo8A=
github.com/GoAdminGroup/themes v0.0.30 h1:rF/++U0o1vH9589uJ22H6OZw+WxuwB8vtSoti9KhdM4=
github.com/GoAdminGroup/themes v0.0.30/go.mod h1:ABCOeBeibfg9DxAsGVa1NzYK9/nIbHT/BuFrCRIKo8A=
github.com/NebulousLabs/fastrand v0.0.0-20181203155948-6fb6489aac4e h1:n+DcnTNkQnHlwpsrHoQtkrJIO7CBx029fw6oR4vIob4=
github.com/NebulousLabs/fastrand v0.0.0-20181203155948-6fb6489aac4e/go.mod h1:Bdzq+51GR4/0DIhaICZEOm+OHvXGwwB2trKZ8B4Y6eQ=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
16 changes: 7 additions & 9 deletions example/root1/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ func main() {

e := engine.Default()

cfg := config.Config{
dir, err := os.Getwd()
if err != nil {
panic(err)
}

if err := e.AddConfig(config.Config{
Databases: config.DatabaseList{
"default": {
Driver: config.DriverSqlite,
Expand All @@ -44,14 +49,7 @@ func main() {
Animation: config.PageAnimation{
Type: "fadeInUp",
},
}

dir, err := os.Getwd()
if err != nil {
panic(err)
}

if err := e.AddConfig(cfg).
}).
AddPlugins(filemanager.
NewFileManager(dir+"/root1").
AddRoot("root2", root.Root{Path: dir + "/root2", Title: "root2"}).
Expand Down

0 comments on commit 6d445c5

Please sign in to comment.