Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
number571 committed Nov 23, 2024
1 parent 12a243a commit 3b2f946
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 18 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

### CHANGES

- `pkg/types`: delete ICloser
- `pkg/logger`: delete GetSettings
- `pkg/network/anonymity/logger`: change interfaces

Expand Down
5 changes: 2 additions & 3 deletions pkg/network/conn/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ package conn

import (
"context"
"io"
"net"
"time"

"github.com/number571/go-peer/pkg/types"

net_message "github.com/number571/go-peer/pkg/network/message"
)

type IConn interface {
types.ICloser
io.Closer

GetSettings() ISettings
GetSocket() net.Conn
Expand Down
4 changes: 2 additions & 2 deletions pkg/network/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package network

import (
"context"
"io"
"time"

"github.com/number571/go-peer/pkg/network/conn"
"github.com/number571/go-peer/pkg/storage/cache"
"github.com/number571/go-peer/pkg/types"

net_message "github.com/number571/go-peer/pkg/network/message"
)
Expand All @@ -19,7 +19,7 @@ type IHandlerF func(
) error

type INode interface {
types.ICloser
io.Closer

Listen(context.Context) error
HandleFunc(uint32, IHandlerF) INode
Expand Down
6 changes: 2 additions & 4 deletions pkg/storage/database/types.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package database

import (
"github.com/number571/go-peer/pkg/types"
)
import "io"

type IKVDatabase interface {
types.ICloser
io.Closer

Set([]byte, []byte) error
Get([]byte) ([]byte, error)
Expand Down
3 changes: 0 additions & 3 deletions pkg/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ package types

import (
"context"
"io"
)

type ICloser io.Closer

type IRunner interface {
Run(context.Context) error
}
Expand Down
2 changes: 1 addition & 1 deletion test/result/badge_codelines.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion test/result/badge_coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions test/result/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3b2f946

Please sign in to comment.