MCPcopy Create free account

hub / github.com/DsThakurRawat/Backend-from-first-Principle / functions

Functions414 in github.com/DsThakurRawat/Backend-from-first-Principle

↓ 54 callersMethodError
()
12. Error Handling and Building Fault Tolerant Systems/errors/types.go:13
↓ 15 callersMethodWriteHeader
(code int)
18. Backend Scaling and Performance Engineering-part-1/code/go/example_2.go:31
↓ 13 callersFunctionwriteJSON
---- helper ----
5. Validations and transformations for backend engineers/code/go/example_8.go:25
↓ 11 callersMethodNow
()
22.Automated-Testing-Unit-Integration-and-E2E/code/go/mocking_time_randomness_external_apis_9.go:2
↓ 7 callersMethodSend
(to, msg string)
22.Automated-Testing-Unit-Integration-and-E2E/code/go/test_doubles_3.go:4
↓ 5 callersMethodRun
One goroutine owns the map → all mutation is serialized here (no locks needed).
24.Web-Sockets-And-Real-time-Communication-with-WebSockets/code/go/connection_management_3.go:9
↓ 5 callersMethodSave
(o Order)
22.Automated-Testing-Unit-Integration-and-E2E/code/go/dependency_injection_for_testability_4.go:2
↓ 5 callersMethodsave
(self, order)
22.Automated-Testing-Unit-Integration-and-E2E/code/python/dependency_injection_for_testability_4.py:14
↓ 4 callersMethodRegister
==================== REGISTER (adding routes) ==================== Register is a METHOD on Router (notice the "(r *Router)" receiver) It adds a new ro
2.Routing-in-backend/Router.go:75
↓ 4 callersFunctionnewSessionID
()
4.Authentication and authorization for backend engineers/code/go/04_sessions_1.go:34
↓ 3 callersMethodHandle
(req Request)
2.Routing-in-backend/code/go/a_router_in_go_1.go:10
↓ 3 callersFunctionPercentile
Percentile returns the p-th percentile from a slice of durations. p must be between 0 and 100.
18. Backend Scaling and Performance Engineering-part-1/code/go/example_1.go:12
↓ 3 callersFunctiongetEnv
(key, fallback string)
14.Production-grade Configuration Management/code/go/93_example_yaml_config_file_1.go:74
↓ 3 callersFunctiongetEnvInt
(key string, fallback int)
14.Production-grade Configuration Management/code/go/93_example_yaml_config_file_1.go:81
↓ 3 callersFunctionserve
()
13.gRPC-and-Inter-Service-Communication-for-Microservices/code/python/unary_rpc_1.py:17
↓ 2 callersMethodAllow
(ctx context.Context)
10.Task queues and background job/rate/sliding_window.go:18
↓ 2 callersMethodFindByID
(id string)
22.Automated-Testing-Unit-Integration-and-E2E/code/go/test_doubles_3.go:2
↓ 2 callersMethodGetUser
The method signature is generated FROM the proto: ctx, *Request -> *Response, error
13.gRPC-and-Inter-Service-Communication-for-Microservices/code/go/unary_rpc_2.go:21
↓ 2 callersFunctionIsStrongPassword
The unit: pure logic, no I/O — trivially testable.
22.Automated-Testing-Unit-Integration-and-E2E/code/go/unit_tests_2.go:2
↓ 2 callersFunctionNewRouter
NewRouter is a CONSTRUCTOR — it creates and returns a new Router We need this because the map inside must be initialized with make() Without make(), t
2.Routing-in-backend/Router.go:57
↓ 2 callersMethodRegister
Register binds method + route -> handler (the dispatch table).
2.Routing-in-backend/code/go/a_router_in_go_1.go:33
↓ 2 callersMethod__init__
(self, status: int, message: str, details=None)
12. Error Handling and Building Fault Tolerant Systems/code/python/python_global_error_handler_fastapi_2.py:11
↓ 2 callersMethod_log
(self, req)
2.Routing-in-backend/code/python/a_router_in_python_1.py:28
↓ 2 callersMethoddispatch
(self, method, url)
2.Routing-in-backend/code/python/a_router_in_python_1.py:53
↓ 2 callersFunctiondone
()
assets/copy-button.js:28
↓ 2 callersFunctionfallback
(text)
assets/copy-button.js:41
↓ 2 callersFunctionhandler
(w http.ResponseWriter, r *http.Request)
1.HTTP-AND-CORS/code/go/compression_the_same_negotiation_applied_11.go:1
↓ 2 callersFunctionhash_key
(k: str)
4.Authentication and authorization for backend engineers/code/python/10_api_key_authentication_8.py:4
↓ 2 callersFunctionisPgError
(err error, code string)
12. Error Handling and Building Fault Tolerant Systems/middleware/error_handler.go:62
↓ 2 callersFunctionis_strong_password
(p: str)
22.Automated-Testing-Unit-Integration-and-E2E/code/python/unit_tests_2.py:2
↓ 2 callersMethodlog
log is a METHOD on BaseHandler — it prints request info It's LOWERCASE → private. Only used internally by handlers.
2.Routing-in-backend/Router.go:185
↓ 2 callersMethodlog
(req Request)
2.Routing-in-backend/code/go/a_router_in_go_1.go:67
↓ 2 callersFunctionnew_session_id
()
4.Authentication and authorization for backend engineers/code/python/04_sessions_1.py:18
↓ 2 callersFunctionpeppered
(pw: str)
4.Authentication and authorization for backend engineers/code/python/04_sessions_2.py:16
↓ 2 callersFunctionpeppered
(pw string)
4.Authentication and authorization for backend engineers/code/go/04_sessions_2.go:21
↓ 2 callersMethodregister
(self, method, pattern, handler)
2.Routing-in-backend/code/python/a_router_in_python_1.py:50
↓ 2 callersFunctionwithdraw
(amount: int)
20.Concurrency & Parallelism: IO Bound vs CPU Bound/code/python/race_conditions_in_asyncawait_too_5.py:3
↓ 2 callersFunctionwithdraw
(amount: int)
20.Concurrency & Parallelism: IO Bound vs CPU Bound/code/python/python_asynciolock_for_async_code_7.py:6
↓ 1 callersMethodChat
(self, request_iterator, context)
13.gRPC-and-Inter-Service-Communication-for-Microservices/code/python/bidirectional_streaming_4.py:5
↓ 1 callersMethodChat
proto: rpc Chat(stream ChatMessage) returns (stream ChatMessage); ===== SERVER: loop Recv() and Send() on the same stream =====
13.gRPC-and-Inter-Service-Communication-for-Microservices/code/go/bidirectional_streaming_5.go:4
↓ 1 callersMethodDeserialize
native -> common format
3.Serialization-and-Deserialization-or-backend-engineers/code/go/serialization_in_go_1.go:11
↓ 1 callersMethodDispatch
==================== DISPATCH (finding & running the right handler) ==================== Dispatch is the CORE of routing — it receives a request and:
2.Routing-in-backend/Router.go:93
↓ 1 callersMethodDispatch
POLYMORPHISM: Dispatch calls h.Handle(req) without knowing which concrete type h is. Same call, different behaviour per handler.
2.Routing-in-backend/code/go/a_router_in_go_1.go:39
↓ 1 callersMethodFindAllBooks
ONE method, ONE shape of result: all books, sorted.
6.controllers-services-repositories-middlewares-and-request-context/code/go/07the_repository_layer_4.go:2
↓ 1 callersMethodGetUser
(self, request, context)
13.gRPC-and-Inter-Service-Communication-for-Microservices/code/python/metadata_deadlines_cancellation_5.py:16
↓ 1 callersMethodGetUser
(self, request, context)
13.gRPC-and-Inter-Service-Communication-for-Microservices/code/python/unary_rpc_1.py:9
↓ 1 callersMethodGetUser
(self, request, context)
13.gRPC-and-Inter-Service-Communication-for-Microservices/code/python/status_codes_error_handling_6.py:5
↓ 1 callersMethodGetUser
SERVER: return a typed status, not a bare error string.
13.gRPC-and-Inter-Service-Communication-for-Microservices/code/go/status_codes_error_handling_7.go:7
↓ 1 callersMethodGetUser
===== SERVER: read metadata, respect the inherited deadline =====
13.gRPC-and-Inter-Service-Communication-for-Microservices/code/go/metadata_deadlines_cancellation_6.go:15
↓ 1 callersFunctionGreet
(repo UserRepo, n Notifier, id string)
22.Automated-Testing-Unit-Integration-and-E2E/code/go/test_doubles_3.go:6
↓ 1 callersMethodListBooks
Notice: no http.Request, no ResponseWriter, no status codes. You cannot tell from this signature that it serves an API.
6.controllers-services-repositories-middlewares-and-request-context/code/go/06the_service_layer_3.go:3
↓ 1 callersMethodListUsers
(self, request, context)
13.gRPC-and-Inter-Service-Communication-for-Microservices/code/python/server_streaming_2.py:5
↓ 1 callersMethodListUsers
proto: rpc ListUsers(ListUsersRequest) returns (stream User); ===== SERVER: receive one req, call stream.Send(...) repeatedly =====
13.gRPC-and-Inter-Service-Communication-for-Microservices/code/go/server_streaming_3.go:4
↓ 1 callersFunctionNewOrderService
injected, not constructed inside
22.Automated-Testing-Unit-Integration-and-E2E/code/go/dependency_injection_for_testability_4.go:6
↓ 1 callersFunctionNewRouter
()
2.Routing-in-backend/code/go/a_router_in_go_1.go:28
↓ 1 callersMethodNow
()
22.Automated-Testing-Unit-Integration-and-E2E/code/go/mocking_time_randomness_external_apis_9.go:4
↓ 1 callersMethodPlace
(o Order)
22.Automated-Testing-Unit-Integration-and-E2E/code/go/dependency_injection_for_testability_4.go:8
↓ 1 callersFunctionRequireRole
(role string)
17.Backend Security: Everything You Need to Know/code/go/use_uuids_not_sequential_ids_in_urls_6.go:1
↓ 1 callersMethodSerialize
(v any)
3.Serialization-and-Deserialization-or-backend-engineers/code/go/serialization_in_go_1.go:10
↓ 1 callersMethodServe
From Go's standard library net/http/server.go (simplified)
20.Concurrency & Parallelism: IO Bound vs CPU Bound/code/go/a_typical_go_handler_1.go:2
↓ 1 callersMethodUploadEvents
(self, request_iterator, context)
13.gRPC-and-Inter-Service-Communication-for-Microservices/code/python/client_streaming_3.py:5
↓ 1 callersMethodUploadEvents
proto: rpc UploadEvents(stream Event) returns (UploadSummary); ===== SERVER: Recv() in a loop, then SendAndClose() once at the end =====
13.gRPC-and-Inter-Service-Communication-for-Microservices/code/go/client_streaming_4.go:4
↓ 1 callersFunctionVerify
verify signature + expiry; returns the claims if valid
4.Authentication and authorization for backend engineers/code/go/05_json_web_tokens_jwt_3.go:23
↓ 1 callersMethod__match
(pattern, path)
2.Routing-in-backend/code/python/a_router_in_python_1.py:64
↓ 1 callersMethodacquire
Returns True if a token was acquired, False if rate limited.
10.Task queues and background job/rate_limiter.py:12
↓ 1 callersFunctionauthenticate
(email: str, pw: str)
4.Authentication and authorization for backend engineers/code/python/17_error_messages_timing_attacks_12.py:6
↓ 1 callersFunctionconfigure_logging
()
15.Logging, Monitoring and Observability/logging_config.py:6
↓ 1 callersFunctioncounterService
(ch chan int, done chan bool)
20.Concurrency & Parallelism: IO Bound vs CPU Bound/code/go/python_asynciolock_for_async_code_4.go:5
↓ 1 callersFunctioncreateBook
---- service + repository (sketched) ----
5. Validations and transformations for backend engineers/code/go/example_8.go:59
↓ 1 callersFunctioncreate_book
(name: str)
5. Validations and transformations for backend engineers/code/python/example_8.py:23
↓ 1 callersMethoddeserialize
(self, data: str)
3.Serialization-and-Deserialization-or-backend-engineers/code/python/serialization_in_python_1.py:12
↓ 1 callersFunctionerror_response
(status, code, message, details=None, request_id="")
7.API-DESIGN-RestAPI/code/python/a_consistent_error_envelope_5.py:4
↓ 1 callersMethodfind_all_books
(self, sort: str)
6.controllers-services-repositories-middlewares-and-request-context/code/python/07the_repository_layer_4.py:6
↓ 1 callersFunctionformatErrors
formatErrors turns validator output into human messages.
5. Validations and transformations for backend engineers/code/go/example_1.go:40
↓ 1 callersFunctiongen
()
13.gRPC-and-Inter-Service-Communication-for-Microservices/code/python/client_streaming_3.py:14
↓ 1 callersFunctiongen
()
1.HTTP-AND-CORS/code/python/large_downloads_server_client_streaming_14.py:14
↓ 1 callersFunctiongenerateSecureToken
(n int)
17.Backend Security: Everything You Need to Know/code/go/complete_secure_login_endpoint_9.go:46
↓ 1 callersFunctiongenerate_docs
(path: str)
11.Full text search using Elasticsearch for blazingly fast search/code/python/streaming_results_from_two_sources_nodej_1.py:25
↓ 1 callersFunctiongetIPLimiter
Per-IP limiter: 5 requests per second, burst of 10
17.Backend Security: Everything You Need to Know/code/go/three_layers_of_rate_limiting_5.go:13
↓ 1 callersFunctiongetLogLevel
()
15.Logging, Monitoring and Observability/logger/logger.go:10
↓ 1 callersFunctiongracefulShutdown
gracefulShutdown releases resources in REVERSE order of acquisition. Acquired: DB -> jobs -> HTTP server. Released: HTTP -> jobs -> DB.
16.Graceful Shutdown/code/go/72_graceful_shutdown_in_python_1.go:51
↓ 1 callersMethodgraceful_shutdown
(self)
16.Graceful Shutdown/code/python/72_graceful_shutdown_in_python_1.py:35
↓ 1 callersFunctiongreet
(repo, notifier, user_id)
22.Automated-Testing-Unit-Integration-and-E2E/code/python/test_doubles_3.py:4
↓ 1 callersMethodhandle
(self, req: "Request")
2.Routing-in-backend/code/python/a_router_in_python_1.py:10
↓ 1 callersFunctionhandle_request
(conn)
20.Concurrency & Parallelism: IO Bound vs CPU Bound/code/python/thread_per_request_in_python_1.py:4
↓ 1 callersFunctionhandle_request
(user_id: int)
20.Concurrency & Parallelism: IO Bound vs CPU Bound/code/python/pythons_asyncio_the_same_idea_2.py:4
↓ 1 callersFunctionhashKey
Store only the HASH of issued keys (like passwords). On each call, hash the presented key and constant-time compare.
4.Authentication and authorization for backend engineers/code/go/10_api_key_authentication_8.go:9
↓ 1 callersFunctionhash_argon
(pw: str)
4.Authentication and authorization for backend engineers/code/python/04_sessions_2.py:20
↓ 1 callersMethodinstall_signal_handlers
(self)
16.Graceful Shutdown/code/python/72_graceful_shutdown_in_python_1.py:22
↓ 1 callersFunctionisRetryable
(err error)
12. Error Handling and Building Fault Tolerant Systems/code/go/automatic_vs_manual_recovery_3.go:29
↓ 1 callersMethodlist_books
(self, sort: str)
6.controllers-services-repositories-middlewares-and-request-context/code/python/06the_service_layer_3.py:7
↓ 1 callersFunctionmain
()
16.Graceful Shutdown/code/python/72_graceful_shutdown_in_python_1.py:57
↓ 1 callersFunctionmake_user
(**overrides)
22.Automated-Testing-Unit-Integration-and-E2E/code/python/fixtures_factories_8.py:11
↓ 1 callersFunctionmatch
==================== PATTERN MATCHING (the URL comparison engine) ==================== match compares a route pattern against an actual URL path and e
2.Routing-in-backend/Router.go:138
↓ 1 callersFunctionmatch
match compares "/users/:id" against "/users/123", filling Params.
2.Routing-in-backend/code/go/a_router_in_go_1.go:50
↓ 1 callersFunctionnewTempStore
A "fixture" via t.Cleanup: setup returns the thing + auto-teardown.
22.Automated-Testing-Unit-Integration-and-E2E/code/go/fixtures_factories_8.go:12
↓ 1 callersFunctionnewUser
Go favors explicit helpers over magic. t.Helper() keeps failure line numbers useful. A "factory" with functional options: specify only the fields that
22.Automated-Testing-Unit-Integration-and-E2E/code/go/fixtures_factories_8.go:3
↓ 1 callersFunctionoutgoing
()
13.gRPC-and-Inter-Service-Communication-for-Microservices/code/python/bidirectional_streaming_4.py:11
↓ 1 callersMethodplace
(self, order)
22.Automated-Testing-Unit-Integration-and-E2E/code/python/dependency_injection_for_testability_4.py:6
↓ 1 callersFunctionready
(fn)
assets/copy-button.js:2
next →1–100 of 414, ranked by callers