Skip to content

Commit

Permalink
Rename package (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
nt0xa authored Jun 18, 2024
1 parent 6bce7ba commit 5bc0fbd
Show file tree
Hide file tree
Showing 103 changed files with 272 additions and 241 deletions.
10 changes: 5 additions & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ brews:
- client

tap:
owner: russtone
owner: nt0xa
name: homebrew-sonar
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"

Expand All @@ -69,10 +69,10 @@ changelog:

dockers:
- image_templates:
- "ghcr.io/russtone/sonar:latest"
- "ghcr.io/russtone/sonar:{{.Major}}"
- "ghcr.io/russtone/sonar:{{.Major}}.{{.Minor}}"
- "ghcr.io/russtone/sonar:{{.Major}}.{{.Minor}}.{{.Patch}}"
- "ghcr.io/nt0xa/sonar:latest"
- "ghcr.io/nt0xa/sonar:{{.Major}}"
- "ghcr.io/nt0xa/sonar:{{.Major}}.{{.Minor}}"
- "ghcr.io/nt0xa/sonar:{{.Major}}.{{.Minor}}.{{.Patch}}"
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sonar

[![Build and test](https://img.shields.io/github/actions/workflow/status/russtone/sonar/build-and-test.yml?branch=master)](https://github.com/russtone/sonar/actions?query=workflow%3A%22Build+and+test%22)
[![Go report](https://goreportcard.com/badge/github.com/russtone/sonar)](https://goreportcard.com/report/github.com/russtone/sonar)
[![Code coverage](https://img.shields.io/codecov/c/gh/russtone/sonar.svg)](https://codecov.io/gh/russtone/sonar)
[![Build and test](https://img.shields.io/github/actions/workflow/status/nt0xa/sonar/build-and-test.yml?branch=master)](https://github.com/nt0xa/sonar/actions?query=workflow%3A%22Build+and+test%22)
[![Go report](https://goreportcard.com/badge/github.com/nt0xa/sonar)](https://goreportcard.com/report/github.com/nt0xa/sonar)
[![Code coverage](https://img.shields.io/codecov/c/gh/nt0xa/sonar.svg)](https://codecov.io/gh/nt0xa/sonar)

8 changes: 4 additions & 4 deletions cmd/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/russtone/sonar/internal/actions"
"github.com/russtone/sonar/internal/cmd"
"github.com/russtone/sonar/internal/modules/api/apiclient"
"github.com/russtone/sonar/internal/templates"
"github.com/nt0xa/sonar/internal/actions"
"github.com/nt0xa/sonar/internal/cmd"
"github.com/nt0xa/sonar/internal/modules/api/apiclient"
"github.com/nt0xa/sonar/internal/templates"
)

var (
Expand Down
28 changes: 14 additions & 14 deletions cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import (
"github.com/kelseyhightower/envconfig"
"github.com/sirupsen/logrus"

"github.com/russtone/sonar/internal/actionsdb"
"github.com/russtone/sonar/internal/cache"
"github.com/russtone/sonar/internal/cmd/server"
"github.com/russtone/sonar/internal/database"
"github.com/russtone/sonar/internal/database/models"
"github.com/russtone/sonar/pkg/dnsx"
"github.com/russtone/sonar/pkg/ftpx"
"github.com/russtone/sonar/pkg/httpx"
"github.com/russtone/sonar/pkg/smtpx"
"github.com/nt0xa/sonar/internal/actionsdb"
"github.com/nt0xa/sonar/internal/cache"
"github.com/nt0xa/sonar/internal/cmd/server"
"github.com/nt0xa/sonar/internal/database"
"github.com/nt0xa/sonar/internal/database/models"
"github.com/nt0xa/sonar/pkg/dnsx"
"github.com/nt0xa/sonar/pkg/ftpx"
"github.com/nt0xa/sonar/pkg/httpx"
"github.com/nt0xa/sonar/pkg/smtpx"
)

func main() {
Expand Down Expand Up @@ -125,7 +125,7 @@ func main() {

go func() {
srv := dnsx.New(
":53",
"127.0.0.1:7753",
dnsHandler,
dnsx.NotifyStartedFunc(waitDNS.Done),
)
Expand Down Expand Up @@ -168,7 +168,7 @@ func main() {

go func() {
srv := httpx.New(
":80",
"127.0.0.1:7780",
server.HTTPHandler(
db,
cfg.Domain,
Expand All @@ -190,7 +190,7 @@ func main() {

go func() {
srv := httpx.New(
":443",
"127.0.0.1:7443",
server.HTTPHandler(
db,
cfg.Domain,
Expand All @@ -213,7 +213,7 @@ func main() {
go func() {
// Pass TLS config to be able to handle "STARTTLS" command.
srv := smtpx.New(
":25",
"127.0.0.1:7725",
smtpx.ListenerWrapper(server.SMTPListenerWrapper(1<<20, time.Second*5)),
smtpx.Messages(smtpx.Msg{Greet: cfg.Domain, Ehlo: cfg.Domain}),
smtpx.OnClose(func(e *smtpx.Event) {
Expand All @@ -234,7 +234,7 @@ func main() {
go func() {
// Pass TLS config to be able to handle "STARTTLS" command.
srv := ftpx.New(
":21",
"127.0.0.1:7721",
ftpx.ListenerWrapper(server.SMTPListenerWrapper(1<<20, time.Second*5)),
ftpx.Messages(ftpx.Msg{Greet: fmt.Sprintf("%s Server ready", cfg.Domain)}),
ftpx.OnClose(func(e *ftpx.Event) {
Expand Down
8 changes: 8 additions & 0 deletions config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[context]
server = 'test'

[servers]
[servers.test]
token = '04a752d6c759f59978755f554bffa08c'
url = 'https://sonar.test:31337'
insecure = true
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/russtone/sonar
module github.com/nt0xa/sonar

go 1.21

Expand Down
2 changes: 1 addition & 1 deletion internal/actions/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
validation "github.com/go-ozzo/ozzo-validation/v4"
"github.com/spf13/cobra"

"github.com/russtone/sonar/internal/utils/errors"
"github.com/nt0xa/sonar/internal/utils/errors"
)

func init() {
Expand Down
6 changes: 3 additions & 3 deletions internal/actions/dns_records.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
validation "github.com/go-ozzo/ozzo-validation/v4"
"github.com/spf13/cobra"

"github.com/russtone/sonar/internal/database/models"
"github.com/russtone/sonar/internal/utils/errors"
"github.com/russtone/sonar/internal/utils/valid"
"github.com/nt0xa/sonar/internal/database/models"
"github.com/nt0xa/sonar/internal/utils/errors"
"github.com/nt0xa/sonar/internal/utils/valid"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/actions/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
validation "github.com/go-ozzo/ozzo-validation/v4"
"github.com/spf13/cobra"

"github.com/russtone/sonar/internal/utils/errors"
"github.com/nt0xa/sonar/internal/utils/errors"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions internal/actions/http_routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
validation "github.com/go-ozzo/ozzo-validation/v4"
"github.com/spf13/cobra"

"github.com/russtone/sonar/internal/database/models"
"github.com/russtone/sonar/internal/utils/errors"
"github.com/russtone/sonar/internal/utils/valid"
"github.com/nt0xa/sonar/internal/database/models"
"github.com/nt0xa/sonar/internal/utils/errors"
"github.com/nt0xa/sonar/internal/utils/valid"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions internal/actions/mock/Actions.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions internal/actions/payloads.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
validation "github.com/go-ozzo/ozzo-validation/v4"
"github.com/spf13/cobra"

"github.com/russtone/sonar/internal/database/models"
"github.com/russtone/sonar/internal/utils/errors"
"github.com/russtone/sonar/internal/utils/valid"
"github.com/nt0xa/sonar/internal/database/models"
"github.com/nt0xa/sonar/internal/utils/errors"
"github.com/nt0xa/sonar/internal/utils/valid"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/actions/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/spf13/cobra"

"github.com/russtone/sonar/internal/utils/errors"
"github.com/nt0xa/sonar/internal/utils/errors"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions internal/actions/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
validation "github.com/go-ozzo/ozzo-validation/v4"
"github.com/spf13/cobra"

"github.com/russtone/sonar/internal/database/models"
"github.com/russtone/sonar/internal/utils/errors"
"github.com/nt0xa/sonar/internal/database/models"
"github.com/nt0xa/sonar/internal/utils/errors"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/actions/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/mitchellh/mapstructure"
"github.com/spf13/cobra"

"github.com/russtone/sonar/internal/utils/errors"
"github.com/nt0xa/sonar/internal/utils/errors"
)

func oneArg(name string) cobra.PositionalArgs {
Expand Down
6 changes: 3 additions & 3 deletions internal/actionsdb/actions.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package actionsdb

import (
"github.com/russtone/sonar/internal/actions"
"github.com/russtone/sonar/internal/database"
"github.com/russtone/sonar/internal/utils/logger"
"github.com/nt0xa/sonar/internal/actions"
"github.com/nt0xa/sonar/internal/database"
"github.com/nt0xa/sonar/internal/utils/logger"
)

type dbactions struct {
Expand Down
6 changes: 3 additions & 3 deletions internal/actionsdb/actions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/require"

"github.com/russtone/sonar/internal/actions"
"github.com/russtone/sonar/internal/actionsdb"
"github.com/russtone/sonar/internal/database"
"github.com/nt0xa/sonar/internal/actions"
"github.com/nt0xa/sonar/internal/actionsdb"
"github.com/nt0xa/sonar/internal/database"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion internal/actionsdb/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"fmt"

"github.com/russtone/sonar/internal/database/models"
"github.com/nt0xa/sonar/internal/database/models"
)

type contextKey string
Expand Down
6 changes: 3 additions & 3 deletions internal/actionsdb/dns_records.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"database/sql"
"strings"

"github.com/russtone/sonar/internal/actions"
"github.com/russtone/sonar/internal/database/models"
"github.com/russtone/sonar/internal/utils/errors"
"github.com/nt0xa/sonar/internal/actions"
"github.com/nt0xa/sonar/internal/database/models"
"github.com/nt0xa/sonar/internal/utils/errors"
)

func DNSRecord(m models.DNSRecord, payloadSubdomain string) actions.DNSRecord {
Expand Down
8 changes: 4 additions & 4 deletions internal/actionsdb/dns_records_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/russtone/sonar/internal/actions"
"github.com/russtone/sonar/internal/actionsdb"
"github.com/russtone/sonar/internal/database/models"
"github.com/russtone/sonar/internal/utils/errors"
"github.com/nt0xa/sonar/internal/actions"
"github.com/nt0xa/sonar/internal/actionsdb"
"github.com/nt0xa/sonar/internal/database/models"
"github.com/nt0xa/sonar/internal/utils/errors"
)

func TestDNSRecordsCreate_Success(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions internal/actionsdb/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"database/sql"
"encoding/base64"

"github.com/russtone/sonar/internal/actions"
"github.com/russtone/sonar/internal/database"
"github.com/russtone/sonar/internal/database/models"
"github.com/russtone/sonar/internal/utils/errors"
"github.com/nt0xa/sonar/internal/actions"
"github.com/nt0xa/sonar/internal/database"
"github.com/nt0xa/sonar/internal/database/models"
"github.com/nt0xa/sonar/internal/utils/errors"
)

func Event(m models.Event) actions.Event {
Expand Down
6 changes: 3 additions & 3 deletions internal/actionsdb/events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/russtone/sonar/internal/actions"
"github.com/russtone/sonar/internal/actionsdb"
"github.com/russtone/sonar/internal/utils/errors"
"github.com/nt0xa/sonar/internal/actions"
"github.com/nt0xa/sonar/internal/actionsdb"
"github.com/nt0xa/sonar/internal/utils/errors"
)

func TestEventsList_Success(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions internal/actionsdb/http_routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"encoding/base64"
"strings"

"github.com/russtone/sonar/internal/actions"
"github.com/russtone/sonar/internal/database/models"
"github.com/russtone/sonar/internal/utils/errors"
"github.com/nt0xa/sonar/internal/actions"
"github.com/nt0xa/sonar/internal/database/models"
"github.com/nt0xa/sonar/internal/utils/errors"
)

func HTTPRoute(m models.HTTPRoute, payloadSubdomain string) actions.HTTPRoute {
Expand Down
8 changes: 4 additions & 4 deletions internal/actionsdb/http_routes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/russtone/sonar/internal/actions"
"github.com/russtone/sonar/internal/actionsdb"
"github.com/russtone/sonar/internal/database/models"
"github.com/russtone/sonar/internal/utils/errors"
"github.com/nt0xa/sonar/internal/actions"
"github.com/nt0xa/sonar/internal/actionsdb"
"github.com/nt0xa/sonar/internal/database/models"
"github.com/nt0xa/sonar/internal/utils/errors"
)

func TestHTTPRoutesCreate_Success(t *testing.T) {
Expand Down
10 changes: 5 additions & 5 deletions internal/actionsdb/payloads.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"context"
"database/sql"

"github.com/russtone/sonar/internal/actions"
"github.com/russtone/sonar/internal/database/models"
"github.com/russtone/sonar/internal/utils"
"github.com/russtone/sonar/internal/utils/errors"
"github.com/russtone/sonar/internal/utils/slice"
"github.com/nt0xa/sonar/internal/actions"
"github.com/nt0xa/sonar/internal/database/models"
"github.com/nt0xa/sonar/internal/utils"
"github.com/nt0xa/sonar/internal/utils/errors"
"github.com/nt0xa/sonar/internal/utils/slice"
)

func Payload(m models.Payload) actions.Payload {
Expand Down
10 changes: 5 additions & 5 deletions internal/actionsdb/payloads_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/russtone/sonar/internal/actions"
"github.com/russtone/sonar/internal/actionsdb"
"github.com/russtone/sonar/internal/database/models"
"github.com/russtone/sonar/internal/utils/errors"
"github.com/russtone/sonar/internal/utils/pointer"
"github.com/nt0xa/sonar/internal/actions"
"github.com/nt0xa/sonar/internal/actionsdb"
"github.com/nt0xa/sonar/internal/database/models"
"github.com/nt0xa/sonar/internal/utils/errors"
"github.com/nt0xa/sonar/internal/utils/pointer"
)

func TestCreatePayload_Success(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions internal/actionsdb/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package actionsdb
import (
"context"

"github.com/russtone/sonar/internal/actions"
"github.com/russtone/sonar/internal/utils/errors"
"github.com/nt0xa/sonar/internal/actions"
"github.com/nt0xa/sonar/internal/utils/errors"
)

func (act *dbactions) ProfileGet(ctx context.Context) (*actions.ProfileGetResult, errors.Error) {
Expand Down
Loading

0 comments on commit 5bc0fbd

Please sign in to comment.