rearrange files and stop using cmd and internal folders

parent 1e96b14e
......@@ -3,8 +3,8 @@
journal.iml
# binary file
cmd/journal/journal
journal
# application config file
cmd/journal/journal.toml
journal.toml
# sqlboiler config file
internal/pkg/sqlboiler.toml
sqlboiler.toml
../../web/app/dist
\ No newline at end of file
package journal
package main
import (
"os"
"github.com/BurntSushi/toml"
)
......
package journal
package main
import (
"database/sql"
......
package journal
package main
import (
"context"
......@@ -7,7 +7,7 @@ import (
"github.com/volatiletech/sqlboiler/boil"
"github.com/volatiletech/sqlboiler/queries/qm"
"gitlab.csos95.com/csos95/journal/internal/pkg/models"
"gitlab.csos95.com/csos95/journal/models"
)
func (db *DB) createEntry(ctx context.Context, userStr, journalStr, title, body string) (*models.Entry, error) {
......
package journal
package main
import (
"net/http"
......
package journal
package main
import "fmt"
......
package journal
package main
import (
"crypto/rand"
......
package journal
package main
import (
"context"
......@@ -7,7 +7,7 @@ import (
"github.com/volatiletech/sqlboiler/boil"
"github.com/volatiletech/sqlboiler/queries/qm"
"gitlab.csos95.com/csos95/journal/internal/pkg/models"
"gitlab.csos95.com/csos95/journal/models"
)
func (db *DB) createJournal(ctx context.Context, userStr, name string) (*models.Journal, error) {
......
package journal
package main
import (
"net/http"
......
......@@ -2,17 +2,15 @@ package main
import (
"log"
"gitlab.csos95.com/csos95/journal/internal/journal"
)
func main() {
config, err := journal.LoadConfig("journal.toml")
config, err := LoadConfig("journal.toml")
if err != nil {
log.Fatalln(err)
}
server, err := journal.NewServer(config)
server, err := NewServer(config)
if err != nil {
log.Fatalln(err)
}
......
package journal
package main
import (
"bytes"
......
package journal
package main
import (
"log"
......@@ -8,7 +8,7 @@ import (
"github.com/gorilla/mux"
"github.com/pkg/errors"
"github.com/rakyll/statik/fs"
_ "gitlab.csos95.com/csos95/journal/internal/pkg/statik"
_ "gitlab.csos95.com/csos95/journal/statik"
)
type Server struct {
......
package journal
package main
import (
"context"
......@@ -10,7 +10,7 @@ import (
"github.com/dgrijalva/jwt-go"
"github.com/volatiletech/sqlboiler/boil"
"github.com/volatiletech/sqlboiler/queries/qm"
"gitlab.csos95.com/csos95/journal/internal/pkg/models"
"gitlab.csos95.com/csos95/journal/models"
)
const (
......
package journal
package main
import (
"net/http"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment