Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authn ¶
type Authn struct {
Enabled bool `mapstructure:"enabled"` // Whether authentication is enabled
Method string `mapstructure:"method"` // The authentication method to be used
Oidc Oidc `mapstructure:"oidc"` // Configuration for OIDC authentication
}
Authn contains configuration for authentication.
type Cache ¶ added in v0.3.1
type Cache struct {
NumberOfCounters int64 `mapstructure:"number_of_counters"` // Number of counters for the cache
MaxCost string `mapstructure:"max_cost"` // Maximum cost for the cache
}
Cache contains configuration for caching.
type Config ¶
type Config struct {
AccountID string `mapstructure:"account_id"`
Server `mapstructure:"server"` // Server configuration for both HTTP and gRPC
Log `mapstructure:"logger"` // Logging configuration
Profiler `mapstructure:"profiler"` // Profiler configuration
Authn `mapstructure:"authn"` // Authentication configuration
Tracer `mapstructure:"tracer"` // Tracing configuration
Meter `mapstructure:"meter"` // Metrics configuration
Service `mapstructure:"service"` // Service configuration
Database `mapstructure:"database"` // Database configuration
Distributed `mapstructure:"distributed"` // Distributed configuration
}
Config is the main configuration structure containing various sections for different aspects of the application.
func NewConfig ¶
NewConfig initializes and returns a new Config object by reading and unmarshalling the configuration file from the given path. It falls back to the DefaultConfig if the file is not found. If there's an error during the process, it returns the error.
func NewConfigWithFile ¶ added in v0.4.0
NewConfigWithFile initializes and returns a new Config object by reading and unmarshalling the configuration file from the given path. It falls back to the DefaultConfig if the file is not found. If there's an error during the process, it returns the error.
type Data ¶ added in v0.5.0
type Data struct{}
Data is a placeholder struct for the data service configuration.
type Database ¶
type Database struct {
Engine string `mapstructure:"engine"` // Database engine type (e.g., "postgres" or "memory")
URI string `mapstructure:"uri"` // Database connection URI
AutoMigrate bool `mapstructure:"auto_migrate"` // Whether to enable automatic migration
MaxOpenConnections int `mapstructure:"max_open_connections"` // Maximum number of open connections to the database
MaxIdleConnections int `mapstructure:"max_idle_connections"` // Maximum number of idle connections to the database
MaxConnectionLifetime time.Duration `mapstructure:"max_connection_lifetime"` // Maximum duration a connection can be reused
MaxConnectionIdleTime time.Duration `mapstructure:"max_connection_idle_time"`
MaxDataPerWrite int `mapstructure:"max_data_per_write"`
MaxRetries int `mapstructure:"max_retries"`
WatchBufferSize int `mapstructure:"watch_buffer_size"`
GarbageCollection GarbageCollection `mapstructure:"garbage_collection"`
}
Database contains configuration for the database.
type Distributed ¶ added in v0.4.0
type GRPC ¶
type GRPC struct {
Port string `mapstructure:"port"` // Port for the gRPC server
TLSConfig TLSConfig `mapstructure:"tls"` // TLS configuration for the gRPC server
}
GRPC contains configuration for the gRPC server.
type GarbageCollection ¶ added in v0.5.0
type HTTP ¶
type HTTP struct {
Enabled bool `mapstructure:"enabled"` // Whether the HTTP server is enabled
Port string `mapstructure:"port"` // Port for the HTTP server
TLSConfig TLSConfig `mapstructure:"tls"` // TLS configuration for the HTTP server
CORSAllowedOrigins []string `mapstructure:"cors_allowed_origins"` // List of allowed origins for CORS
CORSAllowedHeaders []string `mapstructure:"cors_allowed_headers"` // List of allowed headers for CORS
}
HTTP contains configuration for the HTTP server.
type Log ¶
type Log struct {
Level string `mapstructure:"level"` // Logging level
Output string `mapstructure:"output"` // Logging output format, e.g., text, json
}
Log contains configuration for logging.
type Meter ¶ added in v0.2.1
type Meter struct {
Enabled bool `mapstructure:"enabled"` // Whether metrics collection is enabled
Exporter string `mapstructure:"exporter"` // Exporter for metrics data
Endpoint string `mapstructure:"endpoint"` // Endpoint for the metrics exporter
Insecure bool `mapstructure:"insecure"` // Connect to the collector using the HTTP scheme, instead of HTTPS.
URLPath string `mapstructure:"path"` // Path for the metrics exporter, if not defined /v1/metrics will be used
}
Meter contains configuration for metrics collection and reporting.
type Oidc ¶ added in v0.3.1
type Oidc struct {
Issuer string `mapstructure:"issuer"` // OIDC issuer URL
Audience string `mapstructure:"audience"` // OIDC client ID
RefreshInterval time.Duration `mapstructure:"refresh_interval"`
ValidMethods []string `mapstructure:"valid_methods"`
}
Oidc contains configuration for OIDC authentication.
type Permission ¶ added in v0.3.1
type Permission struct {
BulkLimit int `mapstructure:"bulk_limit"` // Limit for bulk operations
ConcurrencyLimit int `mapstructure:"concurrency_limit"` // Limit for concurrent operations
Cache Cache `mapstructure:"cache"` // Cache configuration for the permission service
}
Permission contains configuration for the permission service.
type Preshared ¶ added in v0.3.1
type Preshared struct {
}
Preshared contains configuration for preshared key authentication.
type Profiler ¶ added in v0.3.0
type Profiler struct {
Enabled bool `mapstructure:"enabled"` // Whether the profiler is enabled
Port string `mapstructure:"port"` // Port for the profiler
}
Profiler contains configuration for the profiler.
type Schema ¶ added in v0.3.1
type Schema struct {
Cache Cache `mapstructure:"cache"` // Cache configuration for the schema service
}
Schema contains configuration for the schema service.
type Server ¶
type Server struct {
HTTP `mapstructure:"http"` // HTTP server configuration
GRPC `mapstructure:"grpc"` // gRPC server configuration
RateLimit int64 `mapstructure:"rate_limit"` // Rate limit configuration
}
Server contains the configurations for both HTTP and gRPC servers.
type Service ¶
type Service struct {
CircuitBreaker bool `mapstructure:"circuit_breaker"` // Whether to enable the circuit breaker pattern
Watch Watch `mapstructure:"watch"` // Watch service configuration
Schema Schema `mapstructure:"schema"` // Schema service configuration
Permission Permission `mapstructure:"permission"` // Permission service configuration
Data Data `mapstructure:"data"` // Data service configuration
}
Service contains configuration for various service-level features.
type TLSConfig ¶
type TLSConfig struct {
Enabled bool `mapstructure:"enabled"` // Whether TLS is enabled
CertPath string `mapstructure:"cert"` // Path to the certificate file
KeyPath string `mapstructure:"key"` // Path to the key file
}
TLSConfig contains configuration for TLS.
type Tracer ¶
type Tracer struct {
Enabled bool `mapstructure:"enabled"` // Whether tracing collection is enabled
Exporter string `mapstructure:"exporter"` // Exporter for tracing data
Endpoint string `mapstructure:"endpoint"` // Endpoint for the tracing exporter
Insecure bool `mapstructure:"insecure"` // Connect to the collector using the HTTP scheme, instead of HTTPS.
URLPath string `mapstructure:"path"` // Path for the tracing exporter, if not defined /v1/trace will be used
}
Tracer contains configuration for distributed tracing.