mirror of
https://github.com/onsonr/hway.git
synced 2025-03-10 04:57:08 +00:00
refactor: move common package to pkg directory
This commit is contained in:
parent
659d0fe2e9
commit
d3e41fa69a
@ -90,7 +90,7 @@ dockers:
|
|||||||
- onsonr/hway:latest
|
- onsonr/hway:latest
|
||||||
- ghcr.io/onsonr/hway:{{ .Tag }}
|
- ghcr.io/onsonr/hway:{{ .Tag }}
|
||||||
- ghcr.io/onsonr/hway:latest
|
- ghcr.io/onsonr/hway:latest
|
||||||
dockerfile: ./docker/Dockerfile
|
dockerfile: ./docker/release.Dockerfile
|
||||||
|
|
||||||
announce:
|
announce:
|
||||||
telegram:
|
telegram:
|
||||||
|
@ -5,9 +5,9 @@ import (
|
|||||||
"github.com/labstack/echo-contrib/echoprometheus"
|
"github.com/labstack/echo-contrib/echoprometheus"
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
echomiddleware "github.com/labstack/echo/v4/middleware"
|
echomiddleware "github.com/labstack/echo/v4/middleware"
|
||||||
"github.com/onsonr/hway/app/common"
|
"github.com/onsonr/hway/pkg/common"
|
||||||
config "github.com/onsonr/hway/config"
|
config "github.com/onsonr/hway/pkg/config"
|
||||||
hwayorm "github.com/onsonr/hway/models"
|
hwayorm "github.com/onsonr/hway/pkg/models"
|
||||||
// "github.com/onsonr/hway/pkg/context"
|
// "github.com/onsonr/hway/pkg/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -9,9 +9,9 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/onsonr/hway/app"
|
"github.com/onsonr/hway/app"
|
||||||
"github.com/onsonr/hway/app/common"
|
"github.com/onsonr/hway/pkg/common"
|
||||||
"github.com/onsonr/hway/config"
|
"github.com/onsonr/hway/pkg/config"
|
||||||
hwayorm "github.com/onsonr/hway/models"
|
hwayorm "github.com/onsonr/hway/pkg/models"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
1
go.mod
1
go.mod
@ -189,6 +189,7 @@ require (
|
|||||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||||
github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect
|
github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect
|
||||||
github.com/onsi/ginkgo/v2 v2.22.0 // indirect
|
github.com/onsi/ginkgo/v2 v2.22.0 // indirect
|
||||||
|
github.com/onsonr/nebula v0.1.1 // indirect
|
||||||
github.com/opentracing/opentracing-go v1.2.0 // indirect
|
github.com/opentracing/opentracing-go v1.2.0 // indirect
|
||||||
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
|
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
|
||||||
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
|
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
|
||||||
|
2
go.sum
2
go.sum
@ -750,6 +750,8 @@ github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8=
|
|||||||
github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc=
|
github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc=
|
||||||
github.com/onsonr/crypto v1.50.0 h1:U1oEFPG3v/fPywAUE8VW5w1FSMjpckPS6PLH2bVDI2I=
|
github.com/onsonr/crypto v1.50.0 h1:U1oEFPG3v/fPywAUE8VW5w1FSMjpckPS6PLH2bVDI2I=
|
||||||
github.com/onsonr/crypto v1.50.0/go.mod h1:bBNLhUlfIaBiVRpKprYtPV8h/9nXB32TXMujkKGwg8w=
|
github.com/onsonr/crypto v1.50.0/go.mod h1:bBNLhUlfIaBiVRpKprYtPV8h/9nXB32TXMujkKGwg8w=
|
||||||
|
github.com/onsonr/nebula v0.1.1 h1:YBIbf4JSt8jVz6DI04fa7gKY9fBZ47YBIzwe3Nom+YQ=
|
||||||
|
github.com/onsonr/nebula v0.1.1/go.mod h1:1Dcmw5lB4dvKRKSp55B/iLmN4ejZ4vp1/EB/RzXetAQ=
|
||||||
github.com/onsonr/sonr v0.6.1 h1:pNP2BbOfe/3UN/bZSYNyf9F+nlIpZaqi2LJ6Ol0496w=
|
github.com/onsonr/sonr v0.6.1 h1:pNP2BbOfe/3UN/bZSYNyf9F+nlIpZaqi2LJ6Ol0496w=
|
||||||
github.com/onsonr/sonr v0.6.1/go.mod h1:L4ywLeJemlGD2pmlIX/j3eEKEgu5o/yzgFjkHNr7dAk=
|
github.com/onsonr/sonr v0.6.1/go.mod h1:L4ywLeJemlGD2pmlIX/j3eEKEgu5o/yzgFjkHNr7dAk=
|
||||||
github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk=
|
github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk=
|
||||||
|
@ -2,7 +2,7 @@ package handlers
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
"github.com/onsonr/hway/app/context"
|
"github.com/onsonr/hway/pkg/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ErrorHandler(err error, c echo.Context) {
|
func ErrorHandler(err error, c echo.Context) {
|
||||||
|
@ -2,7 +2,7 @@ package handlers
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
"github.com/onsonr/hway/app/context"
|
"github.com/onsonr/hway/pkg/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
func IndexHandler(c echo.Context) error {
|
func IndexHandler(c echo.Context) error {
|
||||||
|
@ -4,11 +4,11 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
"github.com/onsonr/hway/app/common"
|
|
||||||
"github.com/onsonr/hway/app/context"
|
|
||||||
"github.com/onsonr/hway/app/islands"
|
"github.com/onsonr/hway/app/islands"
|
||||||
"github.com/onsonr/hway/app/views"
|
"github.com/onsonr/hway/app/views"
|
||||||
hwayorm "github.com/onsonr/hway/models"
|
"github.com/onsonr/hway/pkg/common"
|
||||||
|
"github.com/onsonr/hway/pkg/context"
|
||||||
|
hwayorm "github.com/onsonr/hway/pkg/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
func RegisterHandler(g *echo.Group) {
|
func RegisterHandler(g *echo.Group) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@go.Package { name = "github.com/onsonr/hway/config" }
|
@go.Package { name = "github.com/onsonr/hway/pkg/config" }
|
||||||
|
|
||||||
|
|
||||||
open module sonr.net.Hway
|
open module sonr.net.Hway
|
||||||
|
@ -8,4 +8,4 @@ sql:
|
|||||||
emit_interface: true
|
emit_interface: true
|
||||||
emit_json_tags: true
|
emit_json_tags: true
|
||||||
package: "models"
|
package: "models"
|
||||||
out: "../models"
|
out: "../pkg/models"
|
||||||
|
@ -7,9 +7,9 @@ import (
|
|||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
"github.com/medama-io/go-useragent"
|
"github.com/medama-io/go-useragent"
|
||||||
"github.com/onsonr/crypto/mpc"
|
"github.com/onsonr/crypto/mpc"
|
||||||
"github.com/onsonr/hway/app/common"
|
"github.com/onsonr/hway/pkg/common"
|
||||||
hway "github.com/onsonr/hway/config"
|
hway "github.com/onsonr/hway/pkg/config"
|
||||||
hwayorm "github.com/onsonr/hway/internal/models"
|
hwayorm "github.com/onsonr/hway/pkg/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
type GatewayContext struct {
|
type GatewayContext struct {
|
@ -4,7 +4,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
hwayorm "github.com/onsonr/hway/internal/models"
|
hwayorm "github.com/onsonr/hway/pkg/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
func UpdateProfile(c echo.Context) (*hwayorm.Profile, error) {
|
func UpdateProfile(c echo.Context) (*hwayorm.Profile, error) {
|
@ -3,7 +3,7 @@ package context
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/onsonr/hway/app/common"
|
"github.com/onsonr/hway/pkg/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ParamsBank returns the bank params
|
// ParamsBank returns the bank params
|
@ -4,7 +4,7 @@ import (
|
|||||||
gocontext "context"
|
gocontext "context"
|
||||||
|
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
"github.com/onsonr/hway/app/common"
|
"github.com/onsonr/hway/pkg/common"
|
||||||
"github.com/segmentio/ksuid"
|
"github.com/segmentio/ksuid"
|
||||||
"lukechampine.com/blake3"
|
"lukechampine.com/blake3"
|
||||||
)
|
)
|
@ -4,7 +4,7 @@ import (
|
|||||||
"github.com/go-webauthn/webauthn/protocol"
|
"github.com/go-webauthn/webauthn/protocol"
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
"github.com/medama-io/go-useragent"
|
"github.com/medama-io/go-useragent"
|
||||||
hwayorm "github.com/onsonr/hway/internal/models"
|
hwayorm "github.com/onsonr/hway/pkg/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Define the credential structure matching our frontend data
|
// Define the credential structure matching our frontend data
|
@ -2,7 +2,7 @@ package context
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/onsonr/crypto/mpc"
|
"github.com/onsonr/crypto/mpc"
|
||||||
"github.com/onsonr/hway/app/common"
|
"github.com/onsonr/hway/pkg/common"
|
||||||
"lukechampine.com/blake3"
|
"lukechampine.com/blake3"
|
||||||
)
|
)
|
||||||
|
|
@ -1 +1 @@
|
|||||||
package index
|
package errors
|
||||||
|
@ -1 +1 @@
|
|||||||
package index
|
package errors
|
||||||
|
24
x/errors/view.templ
Normal file
24
x/errors/view.templ
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
package errors
|
||||||
|
|
||||||
|
templ ErrorView(error string) {
|
||||||
|
@LayoutView("Error | Sonr.ID") {
|
||||||
|
@LayoutContainer() {
|
||||||
|
@HeroTitle("Error", "Something went wrong.")
|
||||||
|
@Form("/error", "error-form") {
|
||||||
|
@FormBody() {
|
||||||
|
@FormHeader() {
|
||||||
|
<div class="w-full py-2">
|
||||||
|
<sl-avatar shape="circle" size="large" src="https://avatars.githubusercontent.com/u/101929?v=4"></sl-avatar>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
@islands.InputHandle()
|
||||||
|
@FormFooter() {
|
||||||
|
@FormCancel()
|
||||||
|
@FormSubmit("Next")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user