MCPcopy Create free account

hub / github.com/andrey-vk/wdbgp / functions

Functions1,274 in github.com/andrey-vk/wdbgp

↓ 308 callersFunctionwriteJSON
writeJSON writes a JSON response with the given status code.
internal/web/handlers_api_auth.go:38
↓ 295 callersMethodSet
(ctx context.Context, v JSON)
internal/settings/setting.go:32
↓ 281 callersMethodError
Error implements the error interface.
internal/errors/errors.go:31
↓ 273 callersMethodClose
()
internal/store/store.go:126
↓ 256 callersMethodString
String returns a string representation of the state.
internal/retry/circuitbreaker.go:20
↓ 251 callersMethodGet
()
internal/settings/setting.go:31
↓ 178 callersMethodExecContext
(context.Context, string, ...any)
internal/store/dictionaries.go:29
↓ 174 callersMethodScan
(dest ...any)
internal/store/users.go:131
↓ 95 callersFunctionOpen
(path string, backupEnabled bool, backupDir string, autoRestoreEnabled bool)
internal/store/store.go:88
↓ 88 callersFunctionsetupUserTestServer
(t *testing.T)
internal/web/handlers_api_users_test.go:30
↓ 80 callersFunctionnewMockStore
()
internal/settings/setting_test.go:18
↓ 71 callersMethodAddUser
(ctx context.Context, user User)
internal/store/users.go:367
↓ 65 callersFunctionNew
New creates a Settings instance with all fields initialized from env vars, DB values, and computed defaults.
internal/settings/settings.go:107
↓ 65 callersFunctionnewSimple
newSimple creates a new simpleSetting[T]. Precedence: env var -> DB value -> default. The effective value is validated regardless of where it came fr
internal/settings/setting.go:89
↓ 61 callersFunctionopenTestStore
(t *testing.T)
internal/store/store_test.go:11
↓ 56 callersMethodapiUsersCreate
apiUsersCreate handles POST /api/admin/users.
internal/web/handlers_api_users.go:227
↓ 52 callersMethodJSON
(dbSettings map[string]string)
internal/settings/setting.go:36
↓ 50 callersFunctionaddCSRF
nolint:gosec // test-only fixed value, not a real secret addCSRF attaches a matching CSRF cookie and header to req, satisfying validCSRFRequest for mu
internal/web/server_test.go:119
↓ 49 callersMethodapiRequireAdmin
apiRequireAdmin is middleware that validates the admin session cookie. Returns JSON 401 instead of HTML redirect (unlike requireAdmin which is for leg
internal/web/handlers_api_auth.go:121
↓ 49 callersFunctiontestSettings
()
internal/web/server_test.go:19
↓ 47 callersFunctionFromContext
FromContext extracts logger from context, with request ID if available
internal/logging/logging.go:81
↓ 45 callersMethodQueryRowContext
(context.Context, string, ...any)
internal/store/dictionaries.go:31
↓ 44 callersFunctionNew
(st *settings.Settings, s *store.Store, syncer *feeds.Syncer, bgp BGP)
internal/web/server.go:33
↓ 44 callersMethodReset
(ctx context.Context)
internal/settings/setting.go:33
↓ 43 callersMethodQueryContext
(context.Context, string, ...any)
internal/store/routes.go:439
↓ 40 callersMethodUser
(ctx context.Context, id int64)
internal/store/users.go:195
↓ 40 callersFunctionmustSetSetting
mustSetSetting sets a setting and fails the test immediately if it errors — used in test setup, where an unexpected Set() failure means the test's pre
internal/web/handlers_api_settings_test.go:20
↓ 39 callersMethodRun
Run connects to the peer and runs the BGP FSM.
internal/bgp/peer_fsm.go:74
↓ 38 callersMethodTransaction
(ctx context.Context, fn func(*sql.Tx) error)
internal/store/store.go:513
↓ 36 callersFunctionmkStr
(v: string | null, dv: string, env: boolean)
webgui/src/types/__tests__/settings.spec.ts:93
↓ 32 callersMethodWrite
(b []byte)
internal/web/server.go:333
↓ 32 callersMethodapiUsersUpdate
apiUsersUpdate handles PUT /api/admin/users/{id}.
internal/web/handlers_api_users.go:452
↓ 32 callersFunctionmkInt
(v: number | null, dv: number, env: boolean)
webgui/src/types/__tests__/settings.spec.ts:91
↓ 30 callersFunctionadminCookie
adminCookie returns a valid admin session cookie for API tests.
internal/web/server_test.go:107
↓ 29 callersMethodInsertCatalogEntries
InsertCatalogEntries appends entries for a feed in its own transaction — a convenience wrapper around AppendCatalogEntries.
internal/store/dictionaries.go:147
↓ 29 callersMethodStop
()
internal/bgp/peer_fsm.go:540
↓ 28 callersMethodHandler
()
internal/web/server.go:186
↓ 27 callersFunctionstateKey
stateKey builds the peer key used in speaker.PeerStates().
internal/bgp/session_test.go:110
↓ 26 callersFunctionNewSyncer
(s *store.Store, st *settings.Settings)
internal/feeds/feeds.go:69
↓ 26 callersFunctionmountField
(meta: SettingMeta, value: boolean | number | string | null, defaultValue: boolean | number | string, envOverr
webgui/src/components/__tests__/SettingField.spec.ts:51
↓ 25 callersMethodAddFeed
( ctx context.Context, name string, url string, adapterID int64, enabled bool, syncInterval int, data s
internal/store/feeds.go:83
↓ 24 callersFunctionIsNotFound
(err error)
internal/store/store.go:589
↓ 24 callersFunctionwaitForPeerState
waitForState polls a Peer until it reaches the expected state or times out.
internal/bgp/session_test.go:81
↓ 23 callersFunctionwaitForSpeakerPeerState
waitForSpeakerPeerState polls the speaker's peer states for a specific key until it reaches the expected state or times out.
internal/bgp/session_test.go:95
↓ 21 callersFunctionNewPeer
(cfg PeerConfig, spk SpeakerConfig, logger *slog.Logger, routeCB RouteCallback)
internal/bgp/peer_fsm.go:46
↓ 21 callersFunctionReadMessage
ReadMessage reads and decodes a single BGP message from a reader.
internal/bgp/wire_decode.go:35
↓ 20 callersFunctionNewTestStore
NewTestStore returns a Store implementation suitable for tests. All settings start empty (only defaults and env vars apply).
internal/settings/test_helper.go:7
↓ 20 callersMethodSetPeers
SetPeers updates the configured peer list. New peers are started, removed peers are stopped, existing peers are updated if changed.
internal/bgp/speaker.go:117
↓ 20 callersMethodState
State returns the current circuit breaker state.
internal/retry/circuitbreaker.go:129
↓ 19 callersMethodReconcile
(context.Context)
internal/web/types.go:16
↓ 19 callersMethodStop
Stop shuts down the speaker.
internal/bgp/speaker.go:94
↓ 18 callersMethodFeedAdapter
(ctx context.Context, id int64)
internal/store/store.go:564
↓ 18 callersFunctionNewSpeaker
(cfg SpeakerConfig, logger *slog.Logger)
internal/bgp/speaker.go:54
↓ 18 callersMethodStart
Start begins listening on the configured port. If Port is -1, no TCP listener is started (used for testing without BGP).
internal/bgp/speaker.go:64
↓ 18 callersMethodget
(rawURL string)
internal/feeds/javascript.go:226
↓ 18 callersFunctionmkStr
(v: string | null, dv: string, env: boolean)
webgui/src/admin/views/__tests__/SettingsPage.spec.ts:18
↓ 17 callersMethodDesiredPrefixes
(ctx context.Context)
internal/store/routes.go:33
↓ 16 callersMethodFeeds
(ctx context.Context, enabledOnly bool)
internal/store/feeds.go:25
↓ 16 callersMethodPeerStates
(context.Context)
internal/web/types.go:18
↓ 16 callersMethodUserRouteFilters
(ctx context.Context, userID int64)
internal/store/routes.go:293
↓ 16 callersFunctionmkBool
(v: boolean | null, dv: boolean, env: boolean)
webgui/src/types/__tests__/settings.spec.ts:89
↓ 16 callersFunctionmkInt
(v: number | null, dv: number, env: boolean)
webgui/src/admin/views/__tests__/SettingsPage.spec.ts:15
↓ 15 callersFunctioncallStringSetting
(ctx context.Context, st settings.Setting[string, string], raw json.RawMessage)
internal/web/handlers_api_settings.go:514
↓ 15 callersFunctioncontainsAny
containsAny checks if string contains any of the substrings.
internal/retry/retry.go:224
↓ 15 callersFunctionnewComplex
newComplex creates a new complexSetting[T]. defaultJSON is the default in DB/JSON format (a string). Precedence: env var -> DB value -> defaultJSON (
internal/settings/setting.go:146
↓ 15 callersMethodrequireUser
requireUser is middleware that authenticates a user by source IP or session cookie. Sets user ID in context. Returns 401 JSON on failure.
internal/web/handlers_api_user.go:18
↓ 14 callersFunctionNewManager
(s *settings.Settings, db *store.Store)
internal/bgp/manager.go:40
↓ 14 callersMethodUserModeSelection
( ctx context.Context, userID int64, modeID int64, )
internal/store/users.go:549
↓ 14 callersFunctionaggregateStrings
(t *testing.T, in ...string)
internal/prefixfilter/aggregate_test.go:16
↓ 14 callersFunctionprefixes
(values ...string)
internal/prefixfilter/filter_test.go:97
↓ 14 callersFunctionskipBytes
(r io.Reader, n int64)
internal/feeds/srs.go:186
↓ 13 callersMethodError
()
internal/feeds/retry_integration_test.go:125
↓ 13 callersMethodExecute
Execute runs fn through the circuit breaker.
internal/retry/circuitbreaker.go:96
↓ 13 callersMethodOnChange
(fn OnChangeFunc[Runtime])
internal/settings/setting.go:37
↓ 13 callersMethodapiUsersGet
apiUsersGet handles GET /api/admin/users/{id}.
internal/web/handlers_api_users.go:197
↓ 13 callersFunctioncallIntSetting
(ctx context.Context, st settings.Setting[int, int], raw json.RawMessage)
internal/web/handlers_api_settings.go:506
↓ 13 callersFunctioncallIntValidate
(st settings.Setting[int, int], raw json.RawMessage)
internal/web/handlers_api_settings.go:546
↓ 13 callersFunctioncallStringValidate
(st settings.Setting[string, string], raw json.RawMessage)
internal/web/handlers_api_settings.go:554
↓ 13 callersFunctionreadByte
(r io.Reader)
internal/feeds/srs.go:157
↓ 13 callersFunctionsessionToken
(secret string)
internal/web/session.go:14
↓ 12 callersMethodAddCatalogMode
(ctx context.Context, name string, enabled bool)
internal/store/modes.go:66
↓ 12 callersMethodRead
(p []byte)
internal/feeds/srs.go:173
↓ 12 callersMethodStart
(ctx context.Context)
internal/bgp/manager.go:50
↓ 12 callersMethodStop
(ctx context.Context)
internal/bgp/manager.go:65
↓ 12 callersFunctioncloseRowsLogged
(rows *sql.Rows)
internal/store/migrations/033_binary_users.go:392
↓ 12 callersFunctiontestSettings
(t *testing.T, fields map[string]string)
internal/bgp/manager_test.go:17
↓ 12 callersFunctionwantStrings
(values ...string)
internal/prefixfilter/aggregate_test.go:27
↓ 11 callersFunctionDecodePrefix
DecodePrefix converts a stored (ip, bits) pair back to a prefix.
internal/store/ipcodec.go:36
↓ 11 callersMethodGetCommunities
GetCommunities returns all communities for a mode. Map key: category for groups, "category|service" for services. service_id = 0 marks a category-wide
internal/store/communities.go:50
↓ 11 callersFunctionSetUserSelection
( ctx context.Context, tx *sql.Tx, userID int64, categories []string, services []ServiceKey, )
internal/store/users.go:592
↓ 11 callersFunctiondbTableExists
dbTableExists reports whether a table exists, for NoTxSQL migrations that need to detect which step of an interrupted rebuild to resume from.
internal/store/migrations/columns.go:11
↓ 10 callersMethodAddFeedAdapter
(ctx context.Context, adapter FeedAdapter)
internal/store/feed_adapters.go:334
↓ 10 callersMethodCatalogMode
(ctx context.Context, id int64)
internal/store/modes.go:43
↓ 10 callersMethodGenerateCommunities
GenerateCommunities fills missing communities for all categories/services in a mode. Uses the 10000*gap scheme. Skips categories/services that already
internal/store/communities.go:146
↓ 10 callersMethodGetAllSettings
(ctx context.Context)
internal/settings/setting.go:14
↓ 10 callersMethodSetUserCredential
SetUserCredential creates or updates a credential for a user. If password is empty, deletes the credential. Passwords are bcrypt-hashed.
internal/store/users.go:526
↓ 10 callersFunctionWrap
Wrap wraps an existing error with structured information.
internal/errors/errors.go:53
↓ 10 callersMethodadminCookieSecure
adminCookieSecure determines whether admin cookies should have the Secure flag.
internal/web/handlers_api_auth.go:21
↓ 10 callersMethodbuildRoute
buildRoute creates a Route for a single prefix for a specific peer.
internal/bgp/route.go:16
↓ 10 callersFunctionlegacyAddNetwork
legacyAddNetwork bypasses replaceNetworks (which already enforces normalization/overlap going forward) to simulate pre-existing, inconsistent data as
internal/store/030_dedupe_overlapping_networks_test.go:52
next →1–100 of 1,274, ranked by callers