mirror of
https://github.com/foomo/gotsrpc.git
synced 2026-04-16 18:54:26 +00:00
This example showcases gotsrpc's special Context function for centralized authentication. The Context function handles all authentication logic, keeping service methods clean and focused on business logic. Key principle: Centralized authentication via Context function - Context function validates Authorization header once - Service methods remain clean without auth boilerplate - Single point of authentication for entire service Example includes: - AuthService: Login/logout operations - HelloService: Demonstrates Context function pattern - Complete build system with Makefile - TypeScript client with proper ES6 modules - Comprehensive tests and documentation Files: example/auth/ (complete authentication example)
17 lines
542 B
Modula-2
17 lines
542 B
Modula-2
module github.com/foomo/gotsrpc/v2/example/auth
|
|
|
|
go 1.25.0
|
|
|
|
require (
|
|
github.com/foomo/gotsrpc/v2 v2.11.0 // indirect
|
|
github.com/iancoleman/strcase v0.2.0 // indirect
|
|
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
|
github.com/pkg/errors v0.9.1 // indirect
|
|
github.com/ugorji/go/codec v1.2.14 // indirect
|
|
github.com/valyala/gorpc v0.0.0-20160519171614-908281bef774 // indirect
|
|
golang.org/x/mod v0.28.0 // indirect
|
|
golang.org/x/sync v0.17.0 // indirect
|
|
golang.org/x/tools v0.37.0 // indirect
|
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
|
)
|