template-monorepo/internal/svc/service_context.go

27 lines
428 B
Go
Raw Normal View History

2026-05-19 11:00:28 +00:00
// Code scaffolded by goctl. Safe to edit.
// goctl 1.10.1
package svc
import (
"gateway/internal/config"
2026-05-19 12:56:32 +00:00
"gateway/internal/library/validate"
2026-05-19 11:00:28 +00:00
)
type ServiceContext struct {
2026-05-19 12:56:32 +00:00
Config config.Config
Validator validate.Validate
2026-05-19 11:00:28 +00:00
}
func NewServiceContext(c config.Config) *ServiceContext {
2026-05-19 12:56:32 +00:00
v, err := validate.NewWithDefaultEN()
if err != nil {
panic(err)
}
2026-05-19 11:00:28 +00:00
return &ServiceContext{
2026-05-19 12:56:32 +00:00
Config: c,
Validator: v,
2026-05-19 11:00:28 +00:00
}
}