MCPcopy Index your code
hub / github.com/cloudwan/gohan

github.com/cloudwan/gohan @v1.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.0 ↗ · + Follow
2,941 symbols 8,954 edges 381 files 1,598 documented · 54%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Gohan : API gateway server

Join the chat at https://gitter.im/cloudwan/gohan Coverage Status Circle CI Go Report Card

Gohan is an API Gateway Server written by Go that makes it easy for developers to create and maintain REST-style API. An API Gateway Server has a benefit consolidating various API operations such as authentication, authorization based on policies, logging and input validation on a single place on top of so-called microservice architecture.

Gohan also makes transactional operations, involving multiple micro services, easy to operate. An approach Gohan using is quite simple. Persistent REST API Resources in the RDBMS using transaction, then sync resource status with backend microservices using etcd or MySQL binlog API. Using well-proven RDBMs transaction, we can protect correctness of resources. A strategy let backend microservices sync with correct resource data in the RDBMS makes entire system fault-torrent from various RPC failures. Note that Developers should design _ backend microservices idempotent manner, to handle the cases the same RPC invoked multiple times.

see [Pet Store Example] (./etc/example_schema.yaml)

GoDoc

Documentation

Gitbook

Extension points exported contracts — how you extend this code

KeystoneClient (Interface)
KeystoneClient represents keystone client [9 implementers]
cloud/keystone.go
IdentityService (Interface)
IdentityService for user authentication & authorization [9 implementers]
server/middleware/middleware.go
PlainDefaults (Interface)
PlainDefaults is an interface for default values [8 implementers]
converter/defaults/defaults.go
Writer (Interface)
Writer is an interface for displaying output [8 implementers]
converter/writer/writer.go
Environment (Interface)
Environment is a interface for extension environment [8 implementers]
extension/extension.go
Value (Interface)
Value represents gohan script value interface [9 implementers]
extension/gohanscript/value.go
ISync (Interface)
ISync is an interface to sync in Gohan [8 implementers]
extension/goext/sync.go
Sync (Interface)
Sync is a interface for sync servers [5 implementers]
sync/sync.go

Core symbols most depended-on inside this repo

Errorf
called by 434
extension/goext/logger.go
Error
called by 230
extension/goext/logger.go
MatchError
called by 224
extension/goext/test/error.go
Arg
called by 154
extension/gohanscript/stmt.go
HandleEvent
called by 152
extension/goext/core.go
ThrowOttoException
called by 120
extension/otto/otto.go
Fatalf
called by 109
log/log.go
Set
called by 106
singleton/cache.go

Shape

Method 1,537
Function 1,056
Struct 244
TypeAlias 46
Interface 38
FuncType 12
Class 8

Languages

Go97%
TypeScript2%
Python1%

Modules by API surface

extension/goext/environment_mock_gen.go150 symbols
db/sql/sql.go104 symbols
extension/goplugin/environment.go76 symbols
extension/goplugin/schemas.go67 symbols
extension/goext/error.go66 symbols
extension/goext/schemas.go63 symbols
schema/policy.go62 symbols
db/transaction/mocks/transaction.go60 symbols
schema/schema.go49 symbols
db/file/file.go48 symbols
server/resources/resource_management.go42 symbols
extension/goext/types.go42 symbols

Datastores touched

(mysql)Database · 1 repos

For agents

$ claude mcp add gohan \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact