Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIKeyConfig ¶
APIKeyConfig holds API key authentication settings
type AuthConfig ¶
type AuthConfig struct {
APIKey APIKeyConfig
JWT JWTConfig
}
AuthConfig holds authentication configuration
type CORSConfig ¶
type CORSConfig struct {
Enabled bool
AllowOrigins []string
AllowMethods []string
AllowHeaders []string
ExposeHeaders []string
AllowCredentials bool
MaxAge int
}
CORSConfig holds CORS configuration
type Config ¶
type Config struct {
Host string
Port int
Mode string // "development" or "production"
CORS CORSConfig
Auth AuthConfig
RateLimit RateLimitConfig
Logging LoggingConfig
Observability ObservabilityConfig
Database DatabaseConfig
Redis RedisConfig
ReadTimeout time.Duration
WriteTimeout time.Duration
IdleTimeout time.Duration
TLS TLSConfig
}
Config holds all configuration for the aster production server
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a default configuration for development
func ProductionConfig ¶
func ProductionConfig() *Config
ProductionConfig returns a configuration suitable for production
type DatabaseConfig ¶
DatabaseConfig holds database configuration
type Dependencies ¶
type Dependencies struct {
Store store.Store
AgentDeps *agent.Dependencies
}
Dependencies holds all dependencies for the server
type HealthCheckConfig ¶
HealthCheckConfig holds health check settings
type JWTConfig ¶
type JWTConfig struct {
Enabled bool
Secret string
Issuer string
Audience string
TokenDuration int // seconds
Expiry int // seconds (alias for TokenDuration)
ExpiryMinutes int
}
JWTConfig holds JWT authentication settings
type LoggingConfig ¶
LoggingConfig holds logging configuration
type MetricsConfig ¶
MetricsConfig holds metrics configuration
type ObservabilityConfig ¶
type ObservabilityConfig struct {
Enabled bool
Metrics MetricsConfig
Tracing TracingConfig
HealthCheck HealthCheckConfig
}
ObservabilityConfig holds observability settings
type Option ¶
type Option func(*Server)
Option is a function that configures a Server
func WithCustomRouter ¶
WithCustomRouter allows setting a custom Gin router
func WithMiddleware ¶
func WithMiddleware(middlewares ...gin.HandlerFunc) Option
WithMiddleware adds custom gin middlewares to the router
type RateLimitConfig ¶
type RateLimitConfig struct {
Enabled bool
RequestsPerIP int
WindowSize time.Duration
BurstSize int
}
RateLimitConfig holds rate limiting configuration
type RedisConfig ¶
RedisConfig holds Redis configuration
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the aster production server
func New ¶
func New(config *Config, deps *Dependencies, opts ...Option) (*Server, error)
New creates a new Server instance with the given configuration
type TracingConfig ¶
type TracingConfig struct {
Enabled bool
ServiceName string
ServiceVersion string
Environment string
OTLPEndpoint string // OTLP endpoint (e.g., "localhost:4318")
OTLPInsecure bool // Use insecure connection
SamplingRate float64 // 0.0 - 1.0
}
TracingConfig holds tracing configuration