Skip to content

Commit

Permalink
work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
adranwit committed Jul 23, 2023
1 parent 3b8dc68 commit 97ecbda
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 2 deletions.
56 changes: 56 additions & 0 deletions cmd/datly/datly.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package main

import (
"fmt"
"github.com/google/gops/agent"
"github.com/viant/datly/cmd"
"github.com/viant/datly/cmd/env"
"log"
"os"
"strconv"
"time"
)

var (
Version = "development"
BuildTimeInS string
)

func init() {
if BuildTimeInS != "" {
seconds, err := strconv.Atoi(BuildTimeInS)
if err != nil {
panic(err)
}

env.BuildTime = time.Unix(int64(seconds), 0)
}
}

type ConsoleWriter struct{}

func (c *ConsoleWriter) Write(data []byte) (n int, err error) {
fmt.Println(string(data))
return len(data), nil
}

func main() {
fmt.Printf("[INFO] Build time: %v\n", env.BuildTime.String())

go func() {
if err := agent.Listen(agent.Options{}); err != nil {
log.Fatal(err)
}
}()

server, err := cmd.New(Version, os.Args[1:], &ConsoleWriter{})
if err != nil {
log.Fatal(err)
}

if server != nil {
if err := server.ListenAndServe(); err != nil {
log.Fatal(err.Error())
}
}
}
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ require (
github.com/viant/gmetric v0.2.7-0.20220508155136-c2e3c95db446
github.com/viant/godiff v0.4.1
github.com/viant/parsly v0.2.0
github.com/viant/pgo v0.10.3
github.com/viant/pgo v0.10.4-0.20230720010955-0d0835aefe41
github.com/viant/scy v0.6.0
github.com/viant/sqlx v0.9.0
github.com/viant/structql v0.4.1
Expand All @@ -49,7 +49,7 @@ require (

require (
github.com/viant/govalidator v0.2.1
github.com/viant/sqlparser v0.4.0
github.com/viant/sqlparser v0.5.1-0.20230722142201-917df90501d3
golang.org/x/crypto v0.10.0 // indirect
)

Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,14 @@ github.com/viant/parsly v0.2.0 h1:w0i949chDeyI5qdSjwVPggWhcoqX3zB5ut/k0jbAjrU=
github.com/viant/parsly v0.2.0/go.mod h1:4PKQzioRT9R99ceIhZ6tCD3tp0H0n2dEoIOaLulVvrg=
github.com/viant/pgo v0.10.3 h1:q4t+ATJDAgB+VO/7NuzahqPh4u1dYcUNuPaR3mELFSQ=
github.com/viant/pgo v0.10.3/go.mod h1:MFzHmkRFZlciugEgUvpl/3grK789PBSH4dUVSLOSo+Q=
github.com/viant/pgo v0.10.4-0.20230720010955-0d0835aefe41 h1:Ttto7u/jgHbncuFOepzm1gBhL9B4lC671Q4eGM5roDw=
github.com/viant/pgo v0.10.4-0.20230720010955-0d0835aefe41/go.mod h1:MFzHmkRFZlciugEgUvpl/3grK789PBSH4dUVSLOSo+Q=
github.com/viant/scy v0.6.0 h1:QQgq2jKaarDKfJgt9Q2bJlg0Jon/jjL1FfIRyDFzb7E=
github.com/viant/scy v0.6.0/go.mod h1:8DdAWhNVjY6OGOT9+2O7FEAPGDRqy2e+fG6cwIY6jNo=
github.com/viant/sqlparser v0.4.0 h1:LJjXUT1D5a03acJA0IRoGemTWQv1GicFmnreq0ZWe5s=
github.com/viant/sqlparser v0.4.0/go.mod h1:ffKCsz9eb+tv0/nfDguYCcvpYmco/rLHhxhf/kMzKzw=
github.com/viant/sqlparser v0.5.1-0.20230722142201-917df90501d3 h1:V7MKp8G6DuoincR0jHgRhzoru2ZPy8QZpAG+OPhAst4=
github.com/viant/sqlparser v0.5.1-0.20230722142201-917df90501d3/go.mod h1:DqBBJRmfeVVycmCl10uVPzewKVHNLw0sZoPTM2WnRxY=
github.com/viant/sqlx v0.9.0 h1:o/QmTwSkhq63HEyEo9EaVKgVtWhfkW7VScKc0MYOl8s=
github.com/viant/sqlx v0.9.0/go.mod h1:MY0J244wdIMXAkHiDnkCUrihLOKxG6Zeia0ajqJKbbY=
github.com/viant/structology v0.2.0 h1:mntwzS1Xq08u+lLsHO4CvnfIwIrVjX/1PLaW7jyriPs=
Expand Down

0 comments on commit 97ecbda

Please sign in to comment.