Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/andrey-vk/wdbgp
/ functions
Functions
1,274 in github.com/andrey-vk/wdbgp
⨍
Functions
1,274
◇
Types & classes
158
↓ 10 callers
Function
legacyAddUser
legacyAddUser inserts a user directly in the pre-30 schema. It bypasses the store on purpose: the store now speaks the post-33 schema.
internal/store/030_dedupe_overlapping_networks_test.go:33
↓ 10 callers
Function
legacyNetworksFor
(t *testing.T, db *sql.DB, userID int64)
internal/store/030_dedupe_overlapping_networks_test.go:74
↓ 10 callers
Function
stubPrimeVueComponents
()
webgui/src/admin/views/__tests__/PagesSmoke.test.ts:80
↓ 9 callers
Method
Announce
Announce pushes routes to a specific peer, identified by its address and ASN.
internal/bgp/speaker.go:204
↓ 9 callers
Function
Apply
(input []netip.Prefix, lists Lists, maxPrefixes int)
internal/prefixfilter/filter.go:16
↓ 9 callers
Method
AuthenticateUser
AuthenticateUser looks up a user by login credential (login + password). It joins user_credentials with users and compares the bcrypt hash. Returns th
internal/store/users.go:486
↓ 9 callers
Function
Info
(msg string, args ...any)
internal/logging/logging.go:131
↓ 9 callers
Method
RecordUserSnapshot
RecordUserSnapshot saves a user metric snapshot, only when metrics are enabled. peerStates is the BGP peer state map (peer IP:ASN → state string).
internal/store/snapshots.go:246
↓ 9 callers
Method
State
()
internal/bgp/peer_fsm.go:58
↓ 9 callers
Method
Users
(ctx context.Context, enabledOnly bool)
internal/store/users.go:160
↓ 9 callers
Method
Validate
Validate reports whether v would be accepted by Set — same parse and domain-validation steps, without persisting or mutating anything. Lets a caller v
internal/settings/setting.go:44
↓ 9 callers
Method
allow
(ip string)
internal/web/middleware.go:165
↓ 9 callers
Method
apiModesCreate
apiModesCreate handles POST /api/admin/modes.
internal/web/handlers_api_modes.go:100
↓ 9 callers
Function
decodePrefixes
decodePrefixes decodes NLRI/withdrawn prefixes from wire format. afi is the Address Family Identifier (1=IPv4, 2=IPv6).
internal/bgp/wire_decode.go:386
↓ 9 callers
Function
encodePrefixes
encodePrefixes serializes a slice of prefixes into wire format (NLRI / withdrawn).
internal/bgp/wire_encode.go:48
↓ 9 callers
Method
sendNotification
sendNotification sends a BGP NOTIFICATION message.
internal/bgp/peer_fsm.go:521
↓ 9 callers
Method
setState
(state string)
internal/bgp/peer_fsm.go:552
↓ 8 callers
Method
CatalogModes
(ctx context.Context, enabledOnly bool)
internal/store/modes.go:17
↓ 8 callers
Function
EncodePrefixString
EncodePrefixString parses and encodes a textual CIDR in one step.
internal/store/ipcodec.go:59
↓ 8 callers
Function
Error
(msg string, args ...any)
internal/logging/logging.go:139
↓ 8 callers
Function
mkBool
(v: boolean | null, dv: boolean, env: boolean)
webgui/src/admin/views/__tests__/SettingsPage.spec.ts:12
↓ 8 callers
Function
mountUsersPage
()
webgui/src/admin/views/__tests__/UsersPage.spec.ts:118
↓ 8 callers
Function
startSpeakerAndClient
startSpeakerAndClient starts a Speaker as a BGP server and a Peer as a client. The speaker listens on a random free port; the client connects to it.
internal/bgp/session_test.go:34
↓ 7 callers
Method
ActiveNetworksOverlap
ActiveNetworksOverlap reports whether any candidate network overlaps with an active (web_auth network/both/any, and enabled) network belonging to a di
internal/store/users.go:266
↓ 7 callers
Function
AggregateNetworks
AggregateNetworks parses each CIDR, then returns the minimal set of prefixes covering the same address space — masked, deduplicated, and with overlapp
internal/store/users.go:233
↓ 7 callers
Method
CountPrefixes
CountPrefixes returns the number of unique IPv4 and IPv6 prefixes that would be announced for a given explicit selection (categories + services lists)
internal/store/catalog.go:175
↓ 7 callers
Function
EnsureServiceID
EnsureServiceID returns the dictionary id for a (category, service) name pair, creating both rows if needed.
internal/store/dictionaries.go:49
↓ 7 callers
Method
Feed
(ctx context.Context, id int64)
internal/store/feeds.go:65
↓ 7 callers
Method
FeedAdapters
(ctx context.Context)
internal/store/store.go:533
↓ 7 callers
Method
GetFeedSnapshots
GetFeedSnapshots returns feed prefix counts for the last N days.
internal/store/snapshots.go:171
↓ 7 callers
Method
SaveUserSnapshot
SaveUserSnapshot records user metrics, rate-limited to one row per userSnapshotMinInterval. If the last row is within the interval and values changed,
internal/store/snapshots.go:32
↓ 7 callers
Method
Serialize
Serialize encodes the UPDATE message to wire format including header.
internal/bgp/wire_encode.go:170
↓ 7 callers
Method
UpdateCatalogMode
(ctx context.Context, mode CatalogMode)
internal/store/modes.go:51
↓ 7 callers
Method
UserByIP
network, both, any
internal/store/users.go:322
↓ 7 callers
Method
apiFeedsList
(w http.ResponseWriter, r *http.Request)
internal/web/handlers_api_feeds.go:45
↓ 7 callers
Method
clientIP
clientIP returns the address the request should be attributed to. When TrustProxyHeaders is on, the reverse proxy is trusted to append the real clien
internal/web/middleware.go:24
↓ 7 callers
Function
decodePathAttributes
decodePathAttributes decodes path attributes from wire format.
internal/bgp/wire_decode.go:198
↓ 7 callers
Function
encodePathAttribute
encodePathAttribute encodes a single path attribute in TLV format.
internal/bgp/wire_encode.go:10
↓ 7 callers
Function
formatInt
(n int64)
internal/web/handlers_api_user_test.go:587
↓ 7 callers
Function
freeTCPPort
freeTCPPort returns a free TCP port for testing.
internal/bgp/session_test.go:17
↓ 7 callers
Function
freeTCPPortV6
============================================================================= IPv6 session tests — same patterns as IPv4 but over [::1] with IPv6 pref
internal/bgp/session_test.go:804
↓ 7 callers
Method
len
()
internal/bgp/session_test.go:135
↓ 7 callers
Function
mockAdapterFor
(status: number)
webgui/src/api/__tests__/client.spec.ts:5
↓ 7 callers
Function
normalize
(prefixes []netip.Prefix)
internal/prefixfilter/filter.go:112
↓ 7 callers
Method
run
( ctx context.Context, feed store.Feed, adapter store.FeedAdapter, )
internal/feeds/javascript.go:47
↓ 6 callers
Function
Aggregate
Aggregate returns the minimal set of CIDR prefixes that covers exactly the same address space as the input — masking host bits, dropping exact and sub
internal/prefixfilter/aggregate.go:16
↓ 6 callers
Method
BuiltInAdapterVersion
BuiltInAdapterVersion returns the current builtin version for a given adapter ID.
internal/store/feed_adapters.go:273
↓ 6 callers
Method
CatalogForMode
(ctx context.Context, modeID int64, includeDisabled bool)
internal/store/catalog.go:21
↓ 6 callers
Function
Do
Do executes fn with exponential backoff retry.
internal/retry/retry.go:129
↓ 6 callers
Function
EnsureCategoryID
EnsureCategoryID returns the dictionary id for a category name, creating the row if needed. Dictionary rows are append-only: a name referenced by a se
internal/store/dictionaries.go:37
↓ 6 callers
Method
GetUserCredentials
GetUserCredentials returns all login credentials for a user.
internal/store/users.go:504
↓ 6 callers
Method
GetUserSnapshots
GetUserSnapshots returns user metrics for the last N days.
internal/store/snapshots.go:144
↓ 6 callers
Method
IsEnvSet
()
internal/settings/setting.go:34
↓ 6 callers
Function
NewCircuitBreaker
NewCircuitBreaker creates a new circuit breaker with the given configuration.
internal/retry/circuitbreaker.go:88
↓ 6 callers
Method
SetCommunity
SetCommunity upserts a community. service="" means group-level.
internal/store/communities.go:83
↓ 6 callers
Method
SyncAll
(ctx context.Context)
internal/feeds/feeds.go:139
↓ 6 callers
Method
adapterToJSON
(a store.FeedAdapter)
internal/web/handlers_api_adapters.go:32
↓ 6 callers
Method
apiFeedsCreate
(w http.ResponseWriter, r *http.Request)
internal/web/handlers_api_feeds.go:77
↓ 6 callers
Function
callBoolSetting
(ctx context.Context, st settings.Setting[bool, bool], raw json.RawMessage)
internal/web/handlers_api_settings.go:498
↓ 6 callers
Function
callBoolValidate
(st settings.Setting[bool, bool], raw json.RawMessage)
internal/web/handlers_api_settings.go:538
↓ 6 callers
Function
dbTableHasColumn
dbTableHasColumn reports whether a column exists on a table. A missing table yields false, not an error (pragma_table_info returns no rows).
internal/store/migrations/columns.go:20
↓ 6 callers
Function
ifZero
(val, def int)
internal/feeds/feeds.go:90
↓ 6 callers
Method
maxForkedAdapterSuffix
(ctx context.Context, forkedFromID int64)
internal/store/feed_adapters.go:445
↓ 6 callers
Function
mountBanner
()
webgui/src/admin/layout/__tests__/BGPStatusBanner.test.ts:44
↓ 6 callers
Function
newTestManager
newTestManager builds a Manager with its restart-only-setting snapshot (localASN/localAddrV4/localAddrV6) populated to match cfg, mirroring what start
internal/bgp/manager_test.go:30
↓ 6 callers
Function
parseDefaultRule
parseDefaultRule loops items until srsItemFinal.
internal/feeds/srs_parse.go:11
↓ 6 callers
Method
snapshot
()
internal/bgp/session_test.go:129
↓ 6 callers
Function
testLimits
()
internal/feeds/feeds_test.go:29
↓ 5 callers
Function
EncodePrefix
EncodePrefix converts a prefix to its stored (ip, bits) form, masking it so the encoding is canonical.
internal/store/ipcodec.go:30
↓ 5 callers
Function
NewLogger
NewLogger creates a new logger with the specified level and format
internal/logging/logging.go:43
↓ 5 callers
Method
PeerStates
PeerStates returns the BGP state for each configured peer.
internal/bgp/speaker.go:184
↓ 5 callers
Method
RecordFeedSnapshot
RecordFeedSnapshot saves a feed prefix count snapshot, only when metrics are enabled.
internal/store/snapshots.go:225
↓ 5 callers
Method
SaveFeedSnapshot
SaveFeedSnapshot records feed prefix counts, rate-limited to one row per feedSnapshotMinInterval. If the last row is within the interval and values ch
internal/store/snapshots.go:68
↓ 5 callers
Method
Serialize
Serialize encodes the OPEN message to wire format including header. Advertises IPv6 unicast (RFC 4760) and Four-octet ASN (RFC 6793) capabilities. Use
internal/bgp/wire_encode.go:105
↓ 5 callers
Method
Serialize
Serialize encodes the AS_PATH path attribute value. Uses AS_SEQUENCE (type code 2) for both 2-byte and 4-byte ASNs.
internal/bgp/wire_encode.go:246
↓ 5 callers
Method
SetUserRouteFilters
(ctx context.Context, userID int64, filters RouteFilters)
internal/store/routes.go:347
↓ 5 callers
Function
ToggleSelectedCategory
ToggleSelectedCategory adds or removes a single category selection.
internal/store/users.go:652
↓ 5 callers
Method
UpdateFeed
(ctx context.Context, feed Feed)
internal/store/feeds.go:191
↓ 5 callers
Function
ValidateDBPath
ValidateDBPath checks that a database file's parent directory, if it already exists, is actually a directory and is writable. A parent directory that
internal/settings/settings.go:585
↓ 5 callers
Method
apiAdminUserSaveSelections
apiAdminUserSaveSelections handles PUT /api/admin/users/{id}/selections. Saves category/service selections for any user (admin-only), bypassing select
internal/web/handlers_api_users.go:1000
↓ 5 callers
Method
apiFeedsUpdate
(w http.ResponseWriter, r *http.Request)
internal/web/handlers_api_feeds.go:145
↓ 5 callers
Method
apiModeFeedsSet
apiModeFeedsSet handles PUT /api/admin/modes/{id}/feeds.
internal/web/handlers_api_modes.go:244
↓ 5 callers
Function
contains
(prefixes []netip.Prefix, address netip.Addr)
internal/prefixfilter/filter_test.go:105
↓ 5 callers
Function
expectErrorFallback
(componentPath: string, failingUrl: string)
webgui/src/admin/views/__tests__/PagesSmoke.test.ts:278
↓ 5 callers
Function
legacyM30DB
Migration 30 ran against the text-era schema (user_networks.cidr TEXT, users.web_auth TEXT) — migration 33 later converted both to binary/enum form, s
internal/store/030_dedupe_overlapping_networks_test.go:20
↓ 5 callers
Function
mustGet
(t *testing.T, url string)
internal/web/server_spa_test.go:37
↓ 5 callers
Function
newRateLimiter
(window time.Duration, maxRequests int)
internal/web/middleware.go:127
↓ 5 callers
Function
next
()
webgui/src/composables/useSequencedRequest.ts:9
↓ 5 callers
Function
normalize
(value string)
internal/feeds/feeds.go:563
↓ 5 callers
Function
replayMigrationsBefore
replayMigrationsBefore applies every registered migration with Version < stop to db, mirroring store.go's runner (NoTxSQL first, then the transactiona
internal/store/migration_replay_test.go:15
↓ 5 callers
Function
requireUser
requireUser extracts the authenticated user from the request context. Writes a 401 JSON response and returns false if the user is not authenticated.
internal/web/handlers_api_user.go:74
↓ 5 callers
Function
runMigration30
(t *testing.T, db *sql.DB)
internal/store/030_dedupe_overlapping_networks_test.go:59
↓ 5 callers
Method
setBuiltInAdapterVersion
setBuiltInAdapterVersion records the current builtin version for an adapter ID. Guarded by builtInMu since this map is per-Store but can still be read
internal/store/feed_adapters.go:179
↓ 5 callers
Function
setCSRFCookie
setCSRFCookie issues a new CSRF cookie, mirroring the lifetime of the session cookie it accompanies.
internal/web/middleware.go:67
↓ 5 callers
Function
syncTestData
============================================================================= Helpers ================================================================
internal/store/store_auth_settings_test.go:875
↓ 5 callers
Method
userPeerState
(ctx context.Context, u store.User)
internal/web/handlers_api_users.go:130
↓ 5 callers
Function
userToJSON
(u store.User, peerState string)
internal/web/handlers_api_users.go:99
↓ 4 callers
Method
BuiltinAdapterAllowedHosts
BuiltinAdapterAllowedHosts returns the additional allowed hosts declared by a built-in adapter, or empty string if the adapter is not built-in (or a f
internal/store/feed_adapters.go:320
↓ 4 callers
Function
DoWithResult
DoWithResult executes fn with exponential backoff retry and returns a result.
internal/retry/retry.go:176
↓ 4 callers
Method
GlobalRouteFilters
(ctx context.Context)
internal/store/routes.go:261
← previous
next →
101–200 of 1,274, ranked by callers