Skip to content

Commit

Permalink
move some libs into corlib
Browse files Browse the repository at this point in the history
  • Loading branch information
EvgenyGri committed Jun 20, 2024
1 parent fd17f34 commit 87fa2c5
Show file tree
Hide file tree
Showing 53 changed files with 145 additions and 2,899 deletions.
2 changes: 1 addition & 1 deletion cmd/sgroups/app-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"time"

"github.com/H-BF/sgroups/internal/config"
config "github.com/H-BF/corlib/pkg/plain-config"
)

/*//Sample of config
Expand Down
2 changes: 1 addition & 1 deletion cmd/sgroups/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"os"

"github.com/H-BF/sgroups/internal/app"
"github.com/H-BF/sgroups/internal/config"

_ "github.com/H-BF/corlib/app/identity"
"github.com/H-BF/corlib/logger"
pkgNet "github.com/H-BF/corlib/pkg/net"
config "github.com/H-BF/corlib/pkg/plain-config"
"github.com/H-BF/corlib/server"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
Expand Down
2 changes: 1 addition & 1 deletion cmd/sgroups/setup-authn.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"crypto/x509"
"os"

"github.com/H-BF/sgroups/internal/config"
config "github.com/H-BF/corlib/pkg/plain-config"

"github.com/pkg/errors"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/sgroups/setup-server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (

"github.com/H-BF/sgroups/internal/api/sgroups"
"github.com/H-BF/sgroups/internal/app"
"github.com/H-BF/sgroups/internal/config"
_ "github.com/H-BF/sgroups/internal/grpc"

config "github.com/H-BF/corlib/pkg/plain-config"
"github.com/H-BF/corlib/server"
"github.com/H-BF/corlib/server/interceptors"
serverPrometheusMetrics "github.com/H-BF/corlib/server/metrics/prometheus"
Expand Down
2 changes: 1 addition & 1 deletion cmd/to-nft/internal/app-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strings"
"time"

"github.com/H-BF/sgroups/internal/config"
config "github.com/H-BF/corlib/pkg/plain-config"
)

/*// config-sample.yaml
Expand Down
5 changes: 2 additions & 3 deletions cmd/to-nft/internal/dns-resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ import (
"net"
"time"

"github.com/H-BF/sgroups/internal/config"
"github.com/H-BF/sgroups/internal/dns"

"github.com/H-BF/corlib/pkg/backoff"
"github.com/H-BF/corlib/pkg/dns"
config "github.com/H-BF/corlib/pkg/plain-config"
"github.com/ahmetb/go-linq/v3"
bf "github.com/cenkalti/backoff/v4"
"github.com/pkg/errors"
Expand Down
5 changes: 2 additions & 3 deletions cmd/to-nft/internal/events-of-netlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import (
"fmt"
"sync"

"github.com/H-BF/sgroups/pkg/nl"

"github.com/H-BF/corlib/logger"
"github.com/H-BF/corlib/pkg/nl"
"github.com/H-BF/corlib/pkg/patterns/observer"
)

Expand Down Expand Up @@ -110,7 +109,7 @@ func (w *NetlinkEventSource) gatherLinkState(ctx context.Context) (err error) {
}()

var lister nl.LinkLister
if lister, err = nl.NewLinkLister(ctx, nl.WithNetnsName{Netns: w.NetNS}); err != nil {
if lister, err = nl.NewLinkLister(ctx, nl.WithNetnsName(w.NetNS)); err != nil {
return err
}
defer lister.Close() //nolint
Expand Down
244 changes: 0 additions & 244 deletions cmd/to-nft/internal/host/net-conf.go

This file was deleted.

5 changes: 3 additions & 2 deletions cmd/to-nft/internal/jobs/events.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package jobs

import (
"github.com/H-BF/corlib/pkg/patterns/observer"
"github.com/H-BF/sgroups/cmd/to-nft/internal/host"
"github.com/H-BF/sgroups/cmd/to-nft/internal/nft"

"github.com/H-BF/corlib/pkg/host"
"github.com/H-BF/corlib/pkg/patterns/observer"
)

// AppliedConfEvent -
Expand Down
2 changes: 1 addition & 1 deletion cmd/to-nft/internal/jobs/nft-applier-job.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import (
"time"

"github.com/H-BF/sgroups/cmd/to-nft/internal"
"github.com/H-BF/sgroups/cmd/to-nft/internal/host"
"github.com/H-BF/sgroups/cmd/to-nft/internal/nft"
"github.com/H-BF/sgroups/cmd/to-nft/internal/nft/cases"
model "github.com/H-BF/sgroups/internal/models/sgroups"

"github.com/H-BF/corlib/logger"
"github.com/H-BF/corlib/pkg/host"
"github.com/H-BF/corlib/pkg/patterns/observer"
"github.com/H-BF/corlib/pkg/queue"
"github.com/c-robinson/iplib"
Expand Down
2 changes: 1 addition & 1 deletion cmd/to-nft/internal/nft/base-rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"strings"

"github.com/H-BF/sgroups/cmd/to-nft/internal"
"github.com/H-BF/sgroups/internal/config"

pkgNet "github.com/H-BF/corlib/pkg/net"
config "github.com/H-BF/corlib/pkg/plain-config"
"github.com/pkg/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/to-nft/internal/nft/cases/local-data.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"net"
"time"

"github.com/H-BF/sgroups/cmd/to-nft/internal/host"
model "github.com/H-BF/sgroups/internal/models/sgroups"

"github.com/H-BF/corlib/logger"
"github.com/H-BF/corlib/pkg/dict"
"github.com/H-BF/corlib/pkg/host"
"github.com/pkg/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/to-nft/internal/nft/net-conf.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package nft

import (
host "github.com/H-BF/sgroups/cmd/to-nft/internal/host"
"github.com/H-BF/corlib/pkg/host"
)

type (
Expand Down
Loading

0 comments on commit 87fa2c5

Please sign in to comment.