Skip to content

Commit

Permalink
update to go-observer v2
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddify-com committed Feb 12, 2024
1 parent d075d2d commit 68c36fb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions common/urltest/urltest.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"sync"
"time"

"github.com/imkira/go-observer"
"github.com/imkira/go-observer/v2"

Check failure on line 11 in common/urltest/urltest.go

View workflow job for this annotation

GitHub Actions / cross (linux-amd64-v3, linux, amd64, v3)

no required module provides package github.com/imkira/go-observer/v2; to add it:

Check failure on line 11 in common/urltest/urltest.go

View workflow job for this annotation

GitHub Actions / Debug build

no required module provides package github.com/imkira/go-observer/v2; to add it:

Check failure on line 11 in common/urltest/urltest.go

View workflow job for this annotation

GitHub Actions / cross (freebsd-amd64-v3, freebsd, amd64, v3)

no required module provides package github.com/imkira/go-observer/v2; to add it:

Check failure on line 11 in common/urltest/urltest.go

View workflow job for this annotation

GitHub Actions / cross (linux-amd64, linux, amd64, v1)

no required module provides package github.com/imkira/go-observer/v2; to add it:

Check failure on line 11 in common/urltest/urltest.go

View workflow job for this annotation

GitHub Actions / cross (freebsd-amd64, freebsd, amd64, v1)

no required module provides package github.com/imkira/go-observer/v2; to add it:

Check failure on line 11 in common/urltest/urltest.go

View workflow job for this annotation

GitHub Actions / cross (linux-386, linux, 386)

no required module provides package github.com/imkira/go-observer/v2; to add it:

Check failure on line 11 in common/urltest/urltest.go

View workflow job for this annotation

GitHub Actions / cross (linux-armv7, linux, arm, 7)

no required module provides package github.com/imkira/go-observer/v2; to add it:

Check failure on line 11 in common/urltest/urltest.go

View workflow job for this annotation

GitHub Actions / cross (freebsd-arm64, freebsd, arm64)

no required module provides package github.com/imkira/go-observer/v2; to add it:

Check failure on line 11 in common/urltest/urltest.go

View workflow job for this annotation

GitHub Actions / cross (darwin-arm64, darwin, arm64)

no required module provides package github.com/imkira/go-observer/v2; to add it:

Check failure on line 11 in common/urltest/urltest.go

View workflow job for this annotation

GitHub Actions / cross (linux-mipsel-softfloat, linux, mipsle, softfloat)

no required module provides package github.com/imkira/go-observer/v2; to add it:

Check failure on line 11 in common/urltest/urltest.go

View workflow job for this annotation

GitHub Actions / cross (linux-mipsel-hardfloat, linux, mipsle, hardfloat)

no required module provides package github.com/imkira/go-observer/v2; to add it:

Check failure on line 11 in common/urltest/urltest.go

View workflow job for this annotation

GitHub Actions / cross (freebsd-386, freebsd, 386)

no required module provides package github.com/imkira/go-observer/v2; to add it:

Check failure on line 11 in common/urltest/urltest.go

View workflow job for this annotation

GitHub Actions / cross (linux-arm64, linux, arm64)

no required module provides package github.com/imkira/go-observer/v2; to add it:

Check failure on line 11 in common/urltest/urltest.go

View workflow job for this annotation

GitHub Actions / cross (linux-mips64el, linux, mips64le)

no required module provides package github.com/imkira/go-observer/v2; to add it:

Check failure on line 11 in common/urltest/urltest.go

View workflow job for this annotation

GitHub Actions / cross (darwin-amd64, darwin, amd64, v1)

no required module provides package github.com/imkira/go-observer/v2; to add it:

Check failure on line 11 in common/urltest/urltest.go

View workflow job for this annotation

GitHub Actions / cross (linux-mips64, linux, mips64)

no required module provides package github.com/imkira/go-observer/v2; to add it:

Check failure on line 11 in common/urltest/urltest.go

View workflow job for this annotation

GitHub Actions / cross (linux-armv6, linux, arm, 6)

no required module provides package github.com/imkira/go-observer/v2; to add it:

Check failure on line 11 in common/urltest/urltest.go

View workflow job for this annotation

GitHub Actions / Debug build (Go 1.20)

no required module provides package github.com/imkira/go-observer/v2; to add it:
"github.com/sagernet/sing/common"
M "github.com/sagernet/sing/common/metadata"
N "github.com/sagernet/sing/common/network"
Expand All @@ -22,7 +22,7 @@ type History struct {
type HistoryStorage struct {
access sync.RWMutex
delayHistory map[string]*History
updateHook observer.Property
updateHook observer.Property[int]
}

func NewHistoryStorage() *HistoryStorage {
Expand All @@ -31,7 +31,7 @@ func NewHistoryStorage() *HistoryStorage {
}
}

func (s *HistoryStorage) SetHook(hook observer.Property) {
func (s *HistoryStorage) SetHook(hook observer.Property[int]) {
s.updateHook = hook
}

Expand Down
1 change: 1 addition & 0 deletions experimental/libbox/command_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func (s *CommandServer) handleGroupConn(conn net.Conn, onlyGroupItems bool) erro
case <-ctx.Done():
return ctx.Err()
case <-urlTestUpdateStream.Changes():
urlTestUpdateStream.Next()
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions experimental/libbox/command_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"path/filepath"
"sync"

"github.com/imkira/go-observer"
"github.com/imkira/go-observer/v2"
"github.com/sagernet/sing-box/common/urltest"
"github.com/sagernet/sing-box/experimental/clashapi"
"github.com/sagernet/sing-box/log"
Expand All @@ -31,7 +31,7 @@ type CommandServer struct {
service *BoxService

// These channels only work with a single client. if multi-client support is needed, replace with Subscriber/Observer
urlTestUpdate observer.Property
urlTestUpdate observer.Property[int]
modeUpdate chan struct{}
logReset chan struct{}
}
Expand Down

0 comments on commit 68c36fb

Please sign in to comment.