Egg Framework
Complete API documentation for all Egg modules.
One-line service startup API:
func Run(ctx context.Context, opts ...Option) error
Options:
WithService(name, version)WithAppConfig(cfg)WithAutoMigrate(models...)WithRegister(fn)Configuration management API:
func DefaultManager(ctx context.Context, logger log.Logger) (*Manager, error)
Methods:
Bind(target any) errorSnapshot() map[string]stringWatch(fn func()) errorStructured logging API:
func New(opts ...Option) *Logger
Methods:
Info(msg string, kv ...any)Error(err error, msg string, kv ...any)With(kv ...any) *LoggerService lifecycle management API:
func Run(ctx context.Context, services []Service, opts Options) error
Features:
Connect RPC interceptor API:
func DefaultInterceptors(opts Options) []connect.Interceptor
Interceptors:
Storage abstraction API:
func NewGORMStore(opts GORMOptions) (*GORMStore, error)
Methods:
GetDB() *gorm.DBAutoMigrate(models...)Ping(ctx context.Context) error