Skip to content

Commit

Permalink
update packaging #2
Browse files Browse the repository at this point in the history
  • Loading branch information
lnashier authored Mar 6, 2024
2 parents 25dbef8 + 5629983 commit fbd5669
Show file tree
Hide file tree
Showing 35 changed files with 42 additions and 43 deletions.
4 changes: 2 additions & 2 deletions pkg/buildinfo/buildinfo.go → buildinfo/buildinfo.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package buildinfo

import (
"github.com/lnashier/go-app/pkg/env"
"github.com/lnashier/go-app/pkg/zson"
"github.com/lnashier/go-app/env"
"github.com/lnashier/go-app/zson"
"net/http"
"time"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/build.go → cli/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli

import (
"fmt"
"github.com/lnashier/go-app/pkg/log"
"github.com/lnashier/go-app/log"
"os"
"os/signal"
"strings"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/opts.go → cli/opts.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cli

import (
"github.com/lnashier/go-app/pkg/config"
"github.com/lnashier/go-app/config"
)

type Opt func(*opts)
Expand Down
6 changes: 3 additions & 3 deletions pkg/cli/service.go → cli/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/lnashier/go-app/pkg/buildinfo"
"github.com/lnashier/go-app/pkg/config"
"github.com/lnashier/go-app/pkg/log"
"github.com/lnashier/go-app/buildinfo"
"github.com/lnashier/go-app/config"
"github.com/lnashier/go-app/log"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config.go → config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/base64"
"fmt"
"github.com/fsnotify/fsnotify"
"github.com/lnashier/go-app/pkg/env"
"github.com/lnashier/go-app/env"
"github.com/pkg/errors"
"github.com/spf13/viper"
"io"
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions examples/encoder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

# Build & Run

```
```shell
go build -o bin/ .
./bin/encoder base64encode str1 | xargs -L1 ./bin/encoder base64decode
```

# Run

```
```shell
go run . base64encode str1
```
6 changes: 3 additions & 3 deletions examples/encoder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"encoding/base64"
"errors"
"fmt"
"github.com/lnashier/go-app/pkg/cli"
"github.com/lnashier/go-app/pkg/config"
"github.com/lnashier/go-app/pkg/log"
"github.com/lnashier/go-app/cli"
"github.com/lnashier/go-app/config"
"github.com/lnashier/go-app/log"
)

func main() {
Expand Down
5 changes: 2 additions & 3 deletions examples/mockserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

# Build & Run

```
```shell
go build -o bin/ .
./bin/mockserver
```

# Run


```
```shell
go run .
```
12 changes: 6 additions & 6 deletions examples/mockserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package main
import (
"fmt"
"github.com/fsnotify/fsnotify"
"github.com/lnashier/go-app/pkg/config"
"github.com/lnashier/go-app/pkg/env"
chandler "github.com/lnashier/go-app/pkg/http/handler"
"github.com/lnashier/go-app/pkg/http/service"
"github.com/lnashier/go-app/pkg/log"
"github.com/lnashier/go-app/pkg/zson"
"github.com/lnashier/go-app/config"
"github.com/lnashier/go-app/env"
chandler "github.com/lnashier/go-app/http/handler"
"github.com/lnashier/go-app/http/service"
"github.com/lnashier/go-app/log"
"github.com/lnashier/go-app/zson"
"net/http"
)

Expand Down
4 changes: 2 additions & 2 deletions examples/myhttpapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

# Build & Run

```
```shell
go build -o ./bin/myhttpapp ./cmd
./bin/myhttpapp
```

# Run

```
```shell
go run ./cmd
```
6 changes: 3 additions & 3 deletions examples/myhttpapp/app/app.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package app

import (
"github.com/lnashier/go-app/pkg/config"
"github.com/lnashier/go-app/pkg/http/handler"
"github.com/lnashier/go-app/pkg/http/service"
"github.com/lnashier/go-app/config"
"github.com/lnashier/go-app/http/handler"
"github.com/lnashier/go-app/http/service"
"net/http"
)

Expand Down
2 changes: 1 addition & 1 deletion examples/myhttpapp/app/controller.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package app

import "github.com/lnashier/go-app/pkg/config"
import "github.com/lnashier/go-app/config"

type Controller struct {
cfg *config.Config
Expand Down
2 changes: 1 addition & 1 deletion examples/myhttpapp/app/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"crypto/md5"
"errors"
"github.com/gorilla/mux"
chttp "github.com/lnashier/go-app/pkg/http"
chttp "github.com/lnashier/go-app/http"
"net/http"
)

Expand Down
4 changes: 2 additions & 2 deletions examples/myhttpapp/cmd/main.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package main

import (
"github.com/lnashier/go-app/config"
"github.com/lnashier/go-app/examples/myhttpapp/app"
"github.com/lnashier/go-app/pkg/config"
"github.com/lnashier/go-app/pkg/http/service"
"github.com/lnashier/go-app/http/service"
)

func main() {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions pkg/http/handler/error.go → http/handler/error.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package handler

import (
chttp "github.com/lnashier/go-app/pkg/http"
"github.com/lnashier/go-app/pkg/zson"
chttp "github.com/lnashier/go-app/http"
"github.com/lnashier/go-app/zson"
"net/http"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/http/handler/json.go → http/handler/json.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package handler

import (
"github.com/lnashier/go-app/pkg/zson"
"github.com/lnashier/go-app/zson"
"net/http"
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/http/service/build.go → http/service/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package service

import (
"fmt"
"github.com/lnashier/go-app/pkg/log"
"github.com/lnashier/go-app/log"
"os"
"os/signal"
"strings"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/http/service/log.go → http/service/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package service

import (
"bufio"
"github.com/lnashier/go-app/pkg/log"
"github.com/lnashier/go-app/log"
"net"
"net/http"
"time"
Expand Down
2 changes: 1 addition & 1 deletion pkg/http/service/opts.go → http/service/opts.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package service

import (
"github.com/lnashier/go-app/pkg/config"
"github.com/lnashier/go-app/config"
)

type Opt func(*opts)
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions pkg/http/service/server.go → http/service/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"
"errors"
"github.com/gorilla/mux"
"github.com/lnashier/go-app/pkg/buildinfo"
"github.com/lnashier/go-app/pkg/config"
"github.com/lnashier/go-app/pkg/log"
"github.com/lnashier/go-app/buildinfo"
"github.com/lnashier/go-app/config"
"github.com/lnashier/go-app/log"
"github.com/urfave/negroni"
"net/http"
"strings"
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions pkg/log/log.go → log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package log

import (
"fmt"
"github.com/lnashier/go-app/pkg/buildinfo"
"github.com/lnashier/go-app/pkg/env"
"github.com/lnashier/go-app/pkg/zson"
"github.com/lnashier/go-app/buildinfo"
"github.com/lnashier/go-app/env"
"github.com/lnashier/go-app/zson"
"log"
"os"
"time"
Expand Down
File renamed without changes.

0 comments on commit fbd5669

Please sign in to comment.