Add gRPC server support with configurable TLS, environment-based settings, and Wire injection. Implement schedule synchronization service with task runner integration for external course data fetching. - Add gRPC configuration with env var overrides (APP_GRPC_ENABLED, APP_GRPC_PORT, etc.) - Create gRPC server infrastructure with runner task management - Implement ScheduleSyncService for course data synchronization - Add sync endpoint to schedule handler for external system integration - Update repository with context-aware batch delete operation - Wire all dependencies including zap logger for structured logging
18 lines
452 B
Go
18 lines
452 B
Go
package config
|
|
|
|
import "fmt"
|
|
|
|
// GRPCConfig gRPC 服务器配置
|
|
type GRPCConfig struct {
|
|
Enabled bool `mapstructure:"enabled"`
|
|
Port int `mapstructure:"port"`
|
|
TLSEnabled bool `mapstructure:"tls_enabled"`
|
|
TLSCertFile string `mapstructure:"tls_cert_file"`
|
|
TLSKeyFile string `mapstructure:"tls_key_file"`
|
|
}
|
|
|
|
// Address 返回 gRPC 服务器监听地址
|
|
func (c *GRPCConfig) Address() string {
|
|
return fmt.Sprintf(":%d", c.Port)
|
|
}
|