text
stringlengths
9
39.2M
dir
stringlengths
25
226
lang
stringclasses
163 values
created_date
timestamp[s]
updated_date
timestamp[s]
repo_name
stringclasses
751 values
repo_full_name
stringclasses
752 values
star
int64
1.01k
183k
len_tokens
int64
1
18.5M
```go package client import ( "encoding" "fmt" "net" "net/netip" "slices" "strings" "time" "github.com/AdguardTeam/AdGuardHome/internal/filtering" "github.com/AdguardTeam/AdGuardHome/internal/filtering/safesearch" "github.com/AdguardTeam/dnsproxy/proxy" "github.com/AdguardTeam/dnsproxy/upstream" "github.c...
/content/code_sandbox/internal/client/persistent.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,443
```go package client import ( "context" "net/netip" "sync" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghnet" "github.com/AdguardTeam/AdGuardHome/internal/rdns" "github.com/AdguardTeam/AdGuardHome/internal/whois" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" "github.com...
/content/code_sandbox/internal/client/addrproc.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,265
```yaml 'openapi': '3.0.3' 'info': 'contact': 'email': 'devteam@adguard.com' 'name': 'AdGuard Home' 'url': 'path_to_url 'description': | **!! WARNING! API IS AT THE DRAFT STAGE! THINGS WILL BREAK! !!** AdGuard Home REST API, V1 **DRAFT**. Our administration web interface is built on top o...
/content/code_sandbox/openapi/v1.yaml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
36,712
```go package client_test import ( "net/netip" "testing" "github.com/AdguardTeam/AdGuardHome/internal/client" "github.com/stretchr/testify/assert" ) func TestRuntimeIndex(t *testing.T) { const cliSrc = client.SourceARP var ( ip1 = netip.MustParseAddr("1.1.1.1") ip2 = netip.MustParseAddr("2.2.2.2") ip3 =...
/content/code_sandbox/internal/client/runtimeindex_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
494
```go package client import "net/netip" // RuntimeIndex stores information about runtime clients. type RuntimeIndex struct { // index maps IP address to runtime client. index map[netip.Addr]*Runtime } // NewRuntimeIndex returns initialized runtime index. func NewRuntimeIndex() (ri *RuntimeIndex) { return &Runtime...
/content/code_sandbox/internal/client/runtimeindex.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
395
```go package client import ( "net" "net/netip" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) // newIDIndex is a helper function that returns a client index filled with // persistent clients from the m. It also generates a UID for each client. func newIDIndex(m []*Persi...
/content/code_sandbox/internal/client/index_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,635
```go // Package client contains types and logic dealing with AdGuard Home's DNS // clients. // // TODO(a.garipov): Expand. package client import ( "encoding" "fmt" "net/netip" "slices" "github.com/AdguardTeam/AdGuardHome/internal/whois" ) // Source represents the source from which the information about the cli...
/content/code_sandbox/internal/client/client.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,269
```go package client_test import ( "net" "net/netip" "testing" "github.com/AdguardTeam/AdGuardHome/internal/client" "github.com/AdguardTeam/AdGuardHome/internal/whois" "github.com/AdguardTeam/golibs/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) // newStorage is a help...
/content/code_sandbox/internal/client/storage_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
5,533
```go package client_test import ( "net/netip" "testing" "time" "github.com/AdguardTeam/golibs/testutil" ) func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } // testHost is the common hostname for tests. const testHost = "client.example" // testTimeout is the common timeout for tests. const testTime...
/content/code_sandbox/internal/client/client_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
139
```go package client_test import ( "context" "fmt" "io" "net" "net/netip" "testing" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghtest" "github.com/AdguardTeam/AdGuardHome/internal/client" "github.com/AdguardTeam/AdGuardHome/internal/whois" "github.com/AdguardTeam/golibs/errors" "github.com/Adgua...
/content/code_sandbox/internal/client/addrproc_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,897
```go package client import ( "net/netip" "testing" "github.com/AdguardTeam/golibs/container" "github.com/AdguardTeam/golibs/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestPersistent_EqualIDs(t *testing.T) { const ( ip = "0.0.0.0" ip1 = "1.1.1.1" ip2 = "...
/content/code_sandbox/internal/client/persistent_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,586
```go package client import ( "fmt" "net" "net/netip" "slices" "strings" "github.com/AdguardTeam/AdGuardHome/internal/aghalg" "github.com/AdguardTeam/golibs/errors" "golang.org/x/exp/maps" ) // macKey contains MAC as byte array of 6, 8, or 20 bytes. type macKey any // macToKey converts mac into key of type ...
/content/code_sandbox/internal/client/index.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,418
```go package client import ( "fmt" "net" "net/netip" "slices" "sync" "github.com/AdguardTeam/golibs/container" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" ) // Config is the client storage configuration structure. // // TODO(s.chzhen): Expand. type Config struct { // Allowed...
/content/code_sandbox/internal/client/storage.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,013
```go package rdns_test import ( "net/netip" "testing" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghtest" "github.com/AdguardTeam/AdGuardHome/internal/rdns" "github.com/AdguardTeam/golibs/netutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestDefault_Process(...
/content/code_sandbox/internal/rdns/rdns_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
893
```go // Package rdns processes reverse DNS lookup queries. package rdns import ( "net/netip" "time" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" "github.com/bluele/gcache" ) // Interface processes rDNS queries. type Interface interface { // Process makes rDNS request and returns ...
/content/code_sandbox/internal/rdns/rdns.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
941
```go //go:build freebsd || openbsd package dhcpd import ( "net" ) // broadcast sends resp to the broadcast address specific for network interface. func (c *dhcpConn) broadcast(respData []byte, peer *net.UDPAddr) (n int, err error) { // Despite the fact that server4.NewIPv4UDPConn explicitly sets socket // option...
/content/code_sandbox/internal/dhcpd/broadcast_bsd.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
165
```go //go:build freebsd || openbsd package dhcpd import ( "bytes" "net" "testing" "github.com/insomniacslk/dhcp/dhcpv4" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestDHCPConn_Broadcast(t *testing.T) { b := &bytes.Buffer{} var peer *net.UDPAddr udpConn := &fakePacke...
/content/code_sandbox/internal/dhcpd/broadcast_bsd_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
331
```go package dhcpd const bitsPerWord = 64 // bitSet is a sparse bitSet. A nil *bitSet is an empty bitSet. type bitSet struct { words map[uint64]uint64 } // newBitSet returns a new bitset. func newBitSet() (s *bitSet) { return &bitSet{ words: map[uint64]uint64{}, } } // isSet returns true if the bit n is set....
/content/code_sandbox/internal/dhcpd/bitset.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
278
```go package dhcpd import ( "net" "testing" "github.com/AdguardTeam/golibs/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestNewIPRange(t *testing.T) { start4 := net.IP{0, 0, 0, 1} end4 := net.IP{0, 0, 0, 3} start6 := net.IP{ 0x01, 0x00, 0x00, 0x00, 0x00, 0x...
/content/code_sandbox/internal/dhcpd/iprange_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,269
```go package dhcpd import ( "encoding/json" "fmt" "net" "net/netip" "os" "path/filepath" "time" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" ) const ( // leaseExpireStatic is used to define the Expiry field for static // leases. // // Deprecated: Remove it when migration ...
/content/code_sandbox/internal/dhcpd/migrate.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
808
```go package dhcpd import ( "net" "testing" "github.com/stretchr/testify/assert" ) func TestCreateICMPv6RAPacket(t *testing.T) { wantData := []byte{ 0x86, 0x00, 0x00, 0x00, 0x40, 0x40, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x40, 0xc0, 0x00, 0x00, 0x0e, 0x10, 0x00, 0x00,...
/content/code_sandbox/internal/dhcpd/routeradv_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
656
```go //go:build darwin || linux package dhcpd import ( "bytes" "net" "testing" "github.com/insomniacslk/dhcp/dhcpv4" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestDHCPConn_Broadcast(t *testing.T) { b := &bytes.Buffer{} var peers []*net.UDPAddr udpConn := &fakePacke...
/content/code_sandbox/internal/dhcpd/broadcast_others_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
378
```go // On-disk database for lease table package dhcpd import ( "encoding/json" "fmt" "net" "net/netip" "os" "slices" "strings" "time" "github.com/AdguardTeam/AdGuardHome/internal/dhcpsvc" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" "github.com/google/renameio/v2/maybe" ) ...
/content/code_sandbox/internal/dhcpd/db.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,348
```go //go:build darwin || freebsd || linux || openbsd package dhcpd import ( "fmt" "github.com/AdguardTeam/golibs/errors" ) // wrapErrs is a helper to wrap the errors from two independent underlying // connections. func wrapErrs(action string, udpConnErr, rawConnErr error) (err error) { switch { case udpConnEr...
/content/code_sandbox/internal/dhcpd/conn_unix.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
177
```go //go:build darwin || linux package dhcpd import ( "net" ) // broadcast sends resp to the broadcast address specific for network interface. func (c *dhcpConn) broadcast(respData []byte, peer *net.UDPAddr) (n int, err error) { // This write to 0xffffffff reverts some behavior changes made in // path_to_url T...
/content/code_sandbox/internal/dhcpd/broadcast_others.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
219
```go //go:build darwin || freebsd || openbsd package dhcpd import ( "net" "testing" "github.com/AdguardTeam/golibs/testutil" "github.com/google/gopacket" "github.com/google/gopacket/layers" "github.com/insomniacslk/dhcp/dhcpv4" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" //l...
/content/code_sandbox/internal/dhcpd/conn_bsd_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,753
```go package dhcpd import ( "fmt" "math" "math/big" "net" "github.com/AdguardTeam/golibs/errors" ) // ipRange is an inclusive range of IP addresses. A nil range is a range that // doesn't contain any IP addresses. // // It is safe for concurrent use. // // TODO(a.garipov): Perhaps create an optimized version ...
/content/code_sandbox/internal/dhcpd/iprange.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
892
```go //go:build windows package dhcpd import ( "fmt" "net/http" "net/http/httptest" "testing" "github.com/AdguardTeam/AdGuardHome/internal/aghos" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestServer_notImplemented(t *testing.T) { s := &server{} w := httptest.NewRec...
/content/code_sandbox/internal/dhcpd/http_windows_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
159
```go //go:build darwin || freebsd || linux || openbsd package dhcpd import ( "bytes" "fmt" "net" "net/netip" "sync" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghnet" "github.com/AdguardTeam/AdGuardHome/internal/dhcpsvc" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" ...
/content/code_sandbox/internal/dhcpd/v6_unix.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
5,599
```go //go:build darwin || freebsd || linux || openbsd package dhcpd import ( "fmt" "net" "testing" "time" "github.com/AdguardTeam/golibs/netutil" "github.com/AdguardTeam/golibs/testutil" "github.com/insomniacslk/dhcp/dhcpv4" "github.com/stretchr/testify/assert" ) func TestParseOpt(t *testing.T) { testCase...
/content/code_sandbox/internal/dhcpd/options_unix_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,413
```go // Package dhcpd provides a DHCP server. package dhcpd import ( "fmt" "net" "net/netip" "path/filepath" "time" "github.com/AdguardTeam/AdGuardHome/internal/dhcpsvc" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/timeutil" ) const ( // DefaultDHCPLeaseTTL is the default time-to-live...
/content/code_sandbox/internal/dhcpd/dhcpd.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,190
```go package dhcpd import ( "encoding/json" "net/netip" "os" "path/filepath" "testing" "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) const testData = `[ {"mac":"ESIzRFVm","ip":"AQIDBA==","host":"test1","exp":1}, {"mac":"ZlVEMyIR","ip":"BAMCAQ==","host":"test2","exp":123...
/content/code_sandbox/internal/dhcpd/migrate_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
544
```go //go:build linux package dhcpd import ( "net" "testing" "github.com/AdguardTeam/golibs/testutil" "github.com/google/gopacket" "github.com/google/gopacket/layers" "github.com/insomniacslk/dhcp/dhcpv4" "github.com/mdlayher/packet" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require...
/content/code_sandbox/internal/dhcpd/conn_linux_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,732
```go package dhcpd import ( "encoding/binary" "fmt" "net" "sync/atomic" "time" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/netutil" "golang.org/x/net/icmp" "golang.org/x/net/ipv6" ) type raCtx struct { raAllowSLAAC bool // send RA packet...
/content/code_sandbox/internal/dhcpd/routeradv.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,180
```go //go:build darwin || freebsd || openbsd package dhcpd import ( "fmt" "net" "os" "time" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/netutil" "github.com/google/gopacket" "github.com/google/gopacket/layers" "github.com/insomniacslk/dhcp/dhcp...
/content/code_sandbox/internal/dhcpd/conn_bsd.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,389
```go //go:build darwin || freebsd || linux || openbsd package dhcpd import ( "bytes" "fmt" "net" "net/netip" "slices" "strings" "sync" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghnet" "github.com/AdguardTeam/AdGuardHome/internal/dhcpsvc" "github.com/AdguardTeam/golibs/errors" "github.com/Adgu...
/content/code_sandbox/internal/dhcpd/v4_unix.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
10,778
```go //go:build darwin || freebsd || linux || openbsd package dhcpd import ( "encoding/json" "fmt" "io" "net" "net/http" "net/netip" "os" "slices" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghalg" "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" "github.com/AdguardTeam/AdGuardHome/interna...
/content/code_sandbox/internal/dhcpd/http_unix.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
5,635
```go //go:build darwin || freebsd || linux || openbsd package dhcpd import ( "fmt" "net" "net/netip" "strings" "testing" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghnet" "github.com/AdguardTeam/AdGuardHome/internal/dhcpsvc" "github.com/AdguardTeam/golibs/netutil" "github.com/AdguardTeam/golibs/...
/content/code_sandbox/internal/dhcpd/v4_unix_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
7,713
```go //go:build windows package dhcpd import ( "net/http" "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" "github.com/AdguardTeam/AdGuardHome/internal/aghos" ) // jsonError is a generic JSON error response. // // TODO(a.garipov): Merge together with the implementations in .../home and // other packages af...
/content/code_sandbox/internal/dhcpd/http_windows.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
509
```go //go:build darwin || freebsd || linux || openbsd package dhcpd import ( "net" "net/netip" "testing" "time" "github.com/AdguardTeam/AdGuardHome/internal/dhcpsvc" "github.com/insomniacslk/dhcp/dhcpv6" "github.com/insomniacslk/dhcp/iana" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/r...
/content/code_sandbox/internal/dhcpd/v6_unix_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
3,040
```go //go:build darwin || freebsd || linux || openbsd package dhcpd import ( "net" "net/netip" "path/filepath" "slices" "testing" "time" "github.com/AdguardTeam/AdGuardHome/internal/dhcpsvc" "github.com/AdguardTeam/golibs/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require"...
/content/code_sandbox/internal/dhcpd/dhcpd_unix_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,209
```go package dhcpd import ( "fmt" "net" "net/netip" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" "github.com/AdguardTeam/AdGuardHome/internal/aghnet" "github.com/AdguardTeam/AdGuardHome/internal/dhcpsvc" "github.com/AdguardTeam/golibs/errors" ) // ServerConfig is the configuration for the DH...
/content/code_sandbox/internal/dhcpd/config.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,138
```go package dhcpd import ( "math" "testing" "testing/quick" "github.com/stretchr/testify/assert" ) func TestBitSet(t *testing.T) { t.Run("nil", func(t *testing.T) { var s *bitSet ok := s.isSet(0) assert.False(t, ok) assert.NotPanics(t, func() { s.set(0, true) }) ok = s.isSet(0) assert.Fals...
/content/code_sandbox/internal/dhcpd/bitset_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
508
```go //go:build linux package dhcpd import ( "fmt" "net" "os" "time" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/netutil" "github.com/google/gopacket" "github.com/google/gopacket/layers" "github.com/insomniacslk/dhcp/dhcpv4" "github.com/insomn...
/content/code_sandbox/internal/dhcpd/conn_linux.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,369
```go //go:build darwin || freebsd || linux || openbsd package dhcpd import ( "bytes" "encoding/json" "net/http" "net/http/httptest" "net/netip" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) // defaultResponse is a helper that returns the response with default // con...
/content/code_sandbox/internal/dhcpd/http_unix_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,293
```go //go:build windows package dhcpd // 'u-root/u-root' package, a dependency of 'insomniacslk/dhcp' package, doesn't build on Windows import ( "net" "net/netip" "github.com/AdguardTeam/AdGuardHome/internal/dhcpsvc" ) type winServer struct{} // type check var _ DHCPServer = winServer{} func (winServer) Rese...
/content/code_sandbox/internal/dhcpd/v46_windows.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
436
```go package aghtest import ( "crypto/sha256" "encoding/hex" "fmt" "net" "net/netip" "strings" "github.com/AdguardTeam/dnsproxy/upstream" "github.com/AdguardTeam/golibs/errors" "github.com/miekg/dns" ) // Additional Upstream Testing Utilities // Upstream is a mock implementation of upstream.Upstream. // /...
/content/code_sandbox/internal/aghtest/upstream.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,843
```go package aghtest_test import ( "github.com/AdguardTeam/AdGuardHome/internal/aghtest" "github.com/AdguardTeam/AdGuardHome/internal/client" "github.com/AdguardTeam/AdGuardHome/internal/dnsforward" "github.com/AdguardTeam/AdGuardHome/internal/filtering" ) // Put interface checks that cause import cycles here. ...
/content/code_sandbox/internal/aghtest/interface_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
204
```go // Package aghtest contains utilities for testing. package aghtest import ( "crypto/sha256" "io" "net/http" "net/http/httptest" "net/netip" "net/url" "testing" "time" "github.com/AdguardTeam/dnsproxy/proxy" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/netutil" "github.com/Adgua...
/content/code_sandbox/internal/aghtest/aghtest.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
866
```go //go:build darwin || freebsd || linux || openbsd package dhcpd import ( "encoding/hex" "fmt" "net" "strconv" "strings" "time" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/netutil" "github.com/AdguardTeam/golibs/timeutil" "github.com/insomn...
/content/code_sandbox/internal/dhcpd/options_unix.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
3,695
```yaml # This is a file showing example configuration for AdGuard Home. # # TODO(a.garipov): Move to the top level once the rewrite is over. dns: addresses: - '0.0.0.0:53' bootstrap_dns: - '9.9.9.10' - '149.112.112.10' - '2620:fe::10' - '2620:fe::fe:10' upstream_dns: - '8.8.8.8' dns64_prefixes: ...
/content/code_sandbox/internal/next/AdGuardHome.example.yaml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
213
```go package aghtest import ( "context" "net" "net/netip" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghos" "github.com/AdguardTeam/AdGuardHome/internal/next/agh" "github.com/AdguardTeam/AdGuardHome/internal/rdns" "github.com/AdguardTeam/AdGuardHome/internal/whois" "github.com/AdguardTeam/dnsproxy/...
/content/code_sandbox/internal/aghtest/interface.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,396
```go // Package agh contains common entities and interfaces of AdGuard Home. package agh import "context" // Service is the interface for API servers. // // TODO(a.garipov): Consider adding a context to Start. // // TODO(a.garipov): Consider adding a Wait method or making an extension // interface for that. type Ser...
/content/code_sandbox/internal/next/agh/agh.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
434
```go package dnssvc_test import ( "net/netip" "testing" "time" "github.com/AdguardTeam/AdGuardHome/internal/next/dnssvc" "github.com/AdguardTeam/golibs/testutil" "github.com/miekg/dns" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestMain(m *testing.M) { testutil.Discar...
/content/code_sandbox/internal/next/dnssvc/dnssvc_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
825
```go // Package dnssvc contains the AdGuard Home DNS service. // // TODO(a.garipov): Define, if all methods of a *Service should work with a nil // receiver. package dnssvc import ( "context" "fmt" "net" "net/netip" "sync/atomic" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghnet" "github.com/Adguard...
/content/code_sandbox/internal/next/dnssvc/dnssvc.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,790
```go package dnssvc import ( "net/netip" "time" ) // Config is the AdGuard Home DNS service configuration structure. // // TODO(a.garipov): Add timeout for incoming requests. type Config struct { // Addresses are the addresses on which to serve plain DNS queries. Addresses []netip.AddrPort // BootstrapServers ...
/content/code_sandbox/internal/next/dnssvc/config.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
248
```go package websvc // Path constants const ( PathRoot = "/" PathFrontend = "/*filepath" PathHealthCheck = "/health-check" PathV1SettingsAll = "/api/v1/settings/all" PathV1SettingsDNS = "/api/v1/settings/dns" PathV1SettingsHTTP = "/api/v1/settings/http" PathV1SystemInfo = "/api/v1/system/info" ) ```
/content/code_sandbox/internal/next/websvc/path.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
89
```go package websvc import ( "net" "sync" "sync/atomic" "testing" "github.com/AdguardTeam/golibs/testutil/fakenet" "github.com/stretchr/testify/assert" ) func TestWaitListener_Accept(t *testing.T) { var accepted atomic.Bool var l net.Listener = &fakenet.Listener{ OnAccept: func() (conn net.Conn, err error...
/content/code_sandbox/internal/next/websvc/waitlistener_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
215
```go package websvc_test import ( "crypto/tls" "encoding/json" "net/http" "net/netip" "net/url" "testing" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" "github.com/AdguardTeam/AdGuardHome/internal/next/agh" "github.com/AdguardTeam/AdGuardHome/internal/next/dnssvc" "github.com/AdguardTeam/Ad...
/content/code_sandbox/internal/next/websvc/settings_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
723
```go package websvc_test import ( "encoding/json" "net/http" "net/url" "runtime" "testing" "time" "github.com/AdguardTeam/AdGuardHome/internal/next/websvc" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestService_handleGetV1SystemInfo(t *testing.T) { confMgr := newConf...
/content/code_sandbox/internal/next/websvc/system_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
241
```go package websvc_test import ( "context" "encoding/json" "net/http" "net/netip" "net/url" "sync/atomic" "testing" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" "github.com/AdguardTeam/AdGuardHome/internal/aghtest" "github.com/AdguardTeam/AdGuardHome/internal/next/agh" "github.com/Adguar...
/content/code_sandbox/internal/next/websvc/dns_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
661
```go package websvc import ( "net/http" "runtime" "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" "github.com/AdguardTeam/AdGuardHome/internal/version" ) // System Handlers // RespGetV1SystemInfo describes the response of the GET /api/v1/system/info // HTTP API. type RespGetV1SystemInfo struct { Arch ...
/content/code_sandbox/internal/next/websvc/system.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
284
```go package websvc import "time" // testTimeout is the common timeout for tests. const testTimeout = 1 * time.Second ```
/content/code_sandbox/internal/next/websvc/websvc_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
29
```go package websvc import ( "encoding/json" "fmt" "net/http" "net/netip" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" "github.com/AdguardTeam/AdGuardHome/internal/next/dnssvc" ) // DNS Settings Handlers // ReqPatchSettingsDNS describes the request to the PATCH /api/v1/settings/dns // HTTP A...
/content/code_sandbox/internal/next/websvc/dns.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
847
```go package websvc import ( "net/http" "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" ) // All Settings Handlers // RespGetV1SettingsAll describes the response of the GET /api/v1/settings/all // HTTP API. type RespGetV1SettingsAll struct { // TODO(a.garipov): Add more as we go. DNS *HTTPAPIDNSSetting...
/content/code_sandbox/internal/next/websvc/settings.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
394
```go package websvc import ( "net" "sync" ) // Wait Listener // waitListener is a wrapper around a listener that also calls wg.Done() on the // first call to Accept. It is useful in situations where it is important to // catch the precise moment of the first call to Accept, for example when // starting an HTTP s...
/content/code_sandbox/internal/next/websvc/waitlistener.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
179
```go package websvc import ( "context" "encoding/json" "fmt" "net/http" "net/netip" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" "github.com/AdguardTeam/AdGuardHome/internal/next/agh" "github.com/AdguardTeam/golibs/log" ) // HTTP Settings Handlers // ReqPatchSettingsHTTP describes the requ...
/content/code_sandbox/internal/next/websvc/http.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
933
```go package websvc_test import ( "bytes" "context" "encoding/json" "io" "io/fs" "net/http" "net/netip" "net/url" "testing" "time" "github.com/AdguardTeam/AdGuardHome/internal/next/agh" "github.com/AdguardTeam/AdGuardHome/internal/next/dnssvc" "github.com/AdguardTeam/AdGuardHome/internal/next/websvc" "...
/content/code_sandbox/internal/next/websvc/websvc_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,498
```go package websvc_test import ( "context" "crypto/tls" "encoding/json" "net/http" "net/netip" "net/url" "testing" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" "github.com/AdguardTeam/AdGuardHome/internal/next/agh" "github.com/AdguardTeam/AdGuardHome/internal/next/websvc" "github.com/str...
/content/code_sandbox/internal/next/websvc/http_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
554
```go // Package websvc contains the AdGuard Home HTTP API service. // // NOTE: Packages other than cmd must not import this package, as it imports // most other packages. // // TODO(a.garipov): Add tests. package websvc import ( "context" "crypto/tls" "fmt" "io" "io/fs" "net" "net/http" "net/netip" "runtime"...
/content/code_sandbox/internal/next/websvc/websvc.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,444
```go package websvc import ( "crypto/tls" "io/fs" "net/netip" "time" ) // Config is the AdGuard Home web service configuration structure. type Config struct { // Pprof is the configuration for the pprof debug API. It must not be nil. Pprof *PprofConfig // ConfigManager is used to show information about serv...
/content/code_sandbox/internal/next/websvc/config.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
569
```go package configmgr import ( "fmt" "github.com/AdguardTeam/golibs/timeutil" "golang.org/x/exp/constraints" ) // numberOrDuration is the constraint for integer types along with // timeutil.Duration. type numberOrDuration interface { constraints.Integer | timeutil.Duration } // newMustBePositiveError returns ...
/content/code_sandbox/internal/next/configmgr/error.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
204
```go package websvc import ( "net/http" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" "github.com/AdguardTeam/golibs/httphdr" "github.com/AdguardTeam/golibs/log" ) // Middlewares // jsonMw sets the content type of the response to application/json. func jsonMw(h http.Handler) (wrapped http.Handl...
/content/code_sandbox/internal/next/websvc/middleware.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
259
```go package configmgr import ( "fmt" "net/netip" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/timeutil" ) // Configuration Structures // config is the top-level on-disk configuration structure. type config struct { DNS *dnsConfig `yaml:"dns"` HTTP *httpConfig `yaml:"http"` Log *...
/content/code_sandbox/internal/next/configmgr/config.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
903
```go package cmd import ( "os" "strconv" "github.com/AdguardTeam/AdGuardHome/internal/aghos" "github.com/AdguardTeam/AdGuardHome/internal/next/agh" "github.com/AdguardTeam/AdGuardHome/internal/next/configmgr" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/osutil" "github.com/google/rename...
/content/code_sandbox/internal/next/cmd/signal.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,046
```go // Package configmgr defines the AdGuard Home on-disk configuration entities and // configuration manager. // // TODO(a.garipov): Add tests. package configmgr import ( "context" "fmt" "io/fs" "net/netip" "os" "slices" "sync" "time" "github.com/AdguardTeam/AdGuardHome/internal/next/agh" "github.com/Adg...
/content/code_sandbox/internal/next/configmgr/configmgr.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,224
```go package cmd import ( "fmt" "os" "github.com/AdguardTeam/AdGuardHome/internal/aghos" "github.com/AdguardTeam/golibs/log" ) // syslogServiceName is the name of the AdGuard Home service used for writing // logs to the system log. const syslogServiceName = "AdGuardHome" // setLog sets up the text logging. // ...
/content/code_sandbox/internal/next/cmd/log.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
223
```go // Package cmd is the AdGuard Home entry point. It assembles the configuration // file manager, sets up signal processing logic, and so on. // // TODO(a.garipov): Move to the upper-level internal/. package cmd import ( "context" "io/fs" "os" "time" "github.com/AdguardTeam/AdGuardHome/internal/next/configm...
/content/code_sandbox/internal/next/cmd/cmd.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
576
```go package updater import ( "encoding/json" "fmt" "io" "net/http" "slices" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghalg" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/ioutil" "github.com/AdguardTeam/golibs/log" "golang.org/x/exp/maps" ) // TODO(a.garipov): Make con...
/content/code_sandbox/internal/updater/check.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,088
```go package updater import ( "os" "path/filepath" "testing" "github.com/AdguardTeam/AdGuardHome/internal/aghtest" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestUpdater_internal(t *testing.T) { wd := t.TempDir() exePathUnix := filepath.Join(wd, "AdGuardHome.exe") ex...
/content/code_sandbox/internal/updater/updater_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
806
```go package cmd import ( "encoding" "flag" "fmt" "io" "io/fs" "net/netip" "os" "slices" "strings" "github.com/AdguardTeam/AdGuardHome/internal/configmigrate" "github.com/AdguardTeam/AdGuardHome/internal/next/configmgr" "github.com/AdguardTeam/AdGuardHome/internal/version" "github.com/AdguardTeam/golibs...
/content/code_sandbox/internal/next/cmd/opt.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
3,044
```go package updater_test import ( "net/http" "net/http/httptest" "net/url" "testing" "github.com/AdguardTeam/AdGuardHome/internal/aghalg" "github.com/AdguardTeam/AdGuardHome/internal/aghtest" "github.com/AdguardTeam/AdGuardHome/internal/updater" "github.com/AdguardTeam/AdGuardHome/internal/version" "github...
/content/code_sandbox/internal/updater/check_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,286
```go package updater_test import ( "fmt" "net/http" "net/http/httptest" "net/url" "os" "path" "path/filepath" "runtime" "testing" "github.com/AdguardTeam/AdGuardHome/internal/updater" "github.com/AdguardTeam/AdGuardHome/internal/version" "github.com/AdguardTeam/golibs/testutil" "github.com/stretchr/test...
/content/code_sandbox/internal/updater/updater_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
962
```go //go:build tools // Package tools and its main module are a nested internal module containing our // development tool dependencies. // // See path_to_url#how-can-i-track-tool-dependencies-for-a-module. package tools import ( _ "github.com/fzipp/gocyclo/cmd/gocyclo" _ "github.com/golangci/misspell/cmd/misspell...
/content/code_sandbox/internal/tools/tools.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
253
```go //go:build linux package arpdb import ( "bufio" "fmt" "io/fs" "net" "net/netip" "strings" "sync" "github.com/AdguardTeam/AdGuardHome/internal/aghos" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/stringutil" ) func newARPDB() (arp *arpdbs) { // Use the common storage among the i...
/content/code_sandbox/internal/arpdb/arpdb_linux.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,621
```go //go:build darwin || freebsd package arpdb import ( "bufio" "net" "net/netip" "strings" "sync" "github.com/AdguardTeam/golibs/log" ) func newARPDB() (arp *cmdARPDB) { return &cmdARPDB{ parse: parseArpA, ns: &neighs{ mu: &sync.RWMutex{}, ns: make([]Neighbor, 0), }, cmd: "arp", // Use -n ...
/content/code_sandbox/internal/arpdb/arpdb_bsd.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
478
```go //go:build darwin || freebsd package arpdb import ( "net" "net/netip" ) const arpAOutput = ` invalid.mac (1.2.3.4) at 12:34:56:78:910 on el0 ifscope [ethernet] invalid.ip (1.2.3.4.5) at ab:cd:ef:ab:cd:12 on ek0 ifscope [ethernet] invalid.fmt 1 at 12:cd:ef:ab:cd:ef on er0 ifscope [ethernet] hostname.one (192...
/content/code_sandbox/internal/arpdb/arpdb_bsd_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
393
```go // Package updater provides an updater for AdGuardHome. package updater import ( "archive/tar" "archive/zip" "compress/gzip" "fmt" "io" "net/http" "os" "os/exec" "path/filepath" "strings" "sync" "time" "github.com/AdguardTeam/AdGuardHome/internal/version" "github.com/AdguardTeam/golibs/errors" "g...
/content/code_sandbox/internal/updater/updater.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
3,861
```go //go:build windows package arpdb import ( "bufio" "net" "net/netip" "strings" "sync" "github.com/AdguardTeam/golibs/log" ) func newARPDB() (arp *cmdARPDB) { return &cmdARPDB{ parse: parseArpA, ns: &neighs{ mu: &sync.RWMutex{}, ns: make([]Neighbor, 0), }, cmd: "arp", args: []string{"/a"...
/content/code_sandbox/internal/arpdb/arpdb_windows.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
429
```go package arpdb import ( "fmt" "io/fs" "net" "net/netip" "os" "strings" "sync" "testing" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) // testdata is the filesystem containing data for testi...
/content/code_sandbox/internal/arpdb/arpdb_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,901
```go //go:build windows package arpdb import ( "net" "net/netip" ) const arpAOutput = ` Interface: 192.168.1.1 --- 0x7 Internet Address Physical Address Type 192.168.1.2 ab-cd-ef-ab-cd-ef dynamic ::ffff:ffff ef-cd-ab-ef-cd-ab static` var wantNeighs = []Neighbor{{ IP:...
/content/code_sandbox/internal/arpdb/arpdb_windows_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
203
```go //go:build openbsd package arpdb import ( "bufio" "net" "net/netip" "strings" "sync" "github.com/AdguardTeam/golibs/log" ) func newARPDB() (arp *cmdARPDB) { return &cmdARPDB{ parse: parseArpA, ns: &neighs{ mu: &sync.RWMutex{}, ns: make([]Neighbor, 0), }, cmd: "arp", // Use -n flag to av...
/content/code_sandbox/internal/arpdb/arpdb_openbsd.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
467
```go // Package arpdb implements the Network Neighborhood Database. package arpdb import ( "bufio" "bytes" "fmt" "net" "net/netip" "slices" "sync" "github.com/AdguardTeam/AdGuardHome/internal/aghos" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/n...
/content/code_sandbox/internal/arpdb/arpdb.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,521
```go //go:build openbsd package arpdb import ( "net" "net/netip" ) const arpAOutput = ` Host Ethernet Address Netif Expire Flags 1.2.3.4.5 aa:bb:cc:dd:ee:ff em0 permanent 1.2.3.4 12:34:56:78:910 em0 permanent 192.168.1.2 ab:cd:ef:ab:cd:ef em0 19m56s ::ffff:ffff ef:cd:ab:ef:cd:ab em0 per...
/content/code_sandbox/internal/arpdb/arpdb_openbsd_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
247
```go //go:build linux package arpdb import ( "net" "net/netip" "sync" "testing" "testing/fstest" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) const arpAOutputWrt = ` IP address HW type Flags HW address Mask Device 1.2.3.4.5 0x1 0x2 ...
/content/code_sandbox/internal/arpdb/arpdb_linux_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,014
```unknown IP address HW type Flags HW address Mask Device 192.168.1.2 0x1 0x2 ab:cd:ef:ab:cd:ef * wan ::ffff:ffff 0x1 0x0 ef:cd:ab:ef:cd:ab * br-lan 0.0.0.0 0x0 0x0 00:00:00:00:00:00 * unspec 1.2....
/content/code_sandbox/internal/arpdb/testdata/proc_net_arp
unknown
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
188
```go package querylog import ( "fmt" "io" "os" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" ) // qLogReader allows reading from multiple query log files in the reverse // order. // // Please note that this is a stateful object. Internally, it contains a // pointer to a particular...
/content/code_sandbox/internal/querylog/qlogreader.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,182
```go package querylog import ( "fmt" "io" "os" "strings" "sync" "time" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" ) const ( // Timestamp not found errors. errTSNotFound errors.Error = "ts not found" errTSTooLate errors.Error = "ts too late" errTSTooEarly errors.Error = "...
/content/code_sandbox/internal/querylog/qlogfile.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
3,015
```go package querylog import "time" // searchParams represent the search query sent by the client. type searchParams struct { // olderThen represents a parameter for entries that are older than this // parameter value. If not set, disregard it and return any value. olderThan time.Time // searchCriteria is a li...
/content/code_sandbox/internal/querylog/searchparams.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
446
```go package querylog import ( "bytes" "encoding/base64" "net" "net/netip" "strings" "testing" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghtest" "github.com/AdguardTeam/AdGuardHome/internal/filtering" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/netutil" "github.com/Adgua...
/content/code_sandbox/internal/querylog/decode_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
4,654