Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrInitializeBaseComponent = errors.Define("initialize_base_component", "initialize base component") ErrInvalidLogFormat = errors.DefineInvalidArgument("log_format", "invalid log format `{format}`") ErrInitializeLogger = errors.Define("initialize_logger", "initialize logger") ErrInitializeIdentityServer = errors.Define("initialize_identity_server", "initialize Identity Server") ErrInitializeGatewayServer = errors.Define("initialize_gateway_server", "initialize Gateway Server") ErrInitializeNetworkServer = errors.Define("initialize_network_server", "initialize Network Server") ErrInitializeApplicationServer = errors.Define( "initialize_application_server", "initialize Application Server", ) ErrInitializeJoinServer = errors.Define("initialize_join_server", "initialize Join Server") ErrInitializeConsole = errors.Define("initialize_console", "initialize Console") ErrInitializeGatewayConfigurationServer = errors.Define( "initialize_gateway_configuration_server", "initialize Gateway Configuration Server", ) ErrInitializeDeviceTemplateConverter = errors.Define( "initialize_device_template_converter", "initialize Device Template Converter", ) ErrInitializeQRCodeGenerator = errors.Define("initialize_qr_code_generator", "initialize QR Code Generator") ErrInitializePacketBrokerAgent = errors.Define("initialize_packet_broker_agent", "initialize Packet Broker Agent") ErrInitializeDeviceRepository = errors.Define("initialize_device_repository", "initialize Device Repository") ErrInitializeDeviceClaimingServer = errors.Define( "initialize_device_claiming_server", "initialize Device Claiming Server", ) )
Errors returned by component initialization.
var DefaultAssetsBaseURL = DefaultHTTPConfig.Static.Mount
DefaultAssetsBaseURL is the default public URL where the assets are served.
var DefaultBaseConfig = config.Base{ Log: DefaultLogConfig, }
DefaultBaseConfig is the default base component configuration.
var DefaultBlobConfig = config.BlobConfig{ Provider: "local", Local: config.BlobConfigLocal{ Directory: "./public/blob", }, }
DefaultBlobConfig is the default config for the blob store.
var DefaultCacheConfig = config.Cache{ Redis: DefaultRedisConfig, }
DefaultCacheConfig is the default cache configuration.
var DefaultClusterConfig = cluster.Config{}
DefaultClusterConfig is the default cluster configuration.
var DefaultConsolePublicURL = DefaultPublicURL + "/console"
DefaultConsolePublicURL is the default public URL where the Console is served.
var DefaultEventsConfig = func() config.Events { c := config.Events{ Backend: "internal", } c.Redis.Config = DefaultRedisConfig c.Redis.Store.TTL = 10 * time.Minute c.Redis.Store.EntityTTL = 24 * time.Hour c.Redis.Store.EntityCount = 100 c.Redis.Store.CorrelationIDCount = 100 c.Redis.Store.StreamPartitionSize = 64 c.Redis.Workers = 16 c.Redis.Publish.QueueSize = 8192 c.Redis.Publish.MaxWorkers = 1024 c.Batch.TargetSize = 64 c.Batch.Delay = 32 * time.Millisecond return c }()
DefaultEventsConfig is the default config for Events.
var DefaultFrequencyPlansConfig = config.FrequencyPlansConfig{
Directory: "/srv/ttn-lorawan/lorawan-frequency-plans",
URL: "https://raw.githubusercontent.com/TheThingsNetwork/lorawan-frequency-plans/master",
}
DefaultFrequencyPlansConfig is the default config to retrieve frequency plans.
var DefaultGRPCConfig = config.GRPC{ Listen: ":1884", ListenTLS: ":8884", TrustedProxies: []string{"127.0.0.0/8", "10.0.0.0/8", "100.64.0.0/10", "172.16.0.0/12", "192.168.0.0/16"}, }
DefaultGRPCConfig is the default config for GRPC.
var DefaultHTTPConfig = config.HTTP{ Listen: ":1885", ListenTLS: ":8885", TrustedProxies: []string{"127.0.0.0/8", "10.0.0.0/8", "100.64.0.0/10", "172.16.0.0/12", "192.168.0.0/16"}, Static: config.HTTPStaticConfig{ Mount: "/assets", SearchPath: []string{"public", "/srv/ttn-lorawan/public"}, }, PProf: config.PProf{ Enable: true, }, Metrics: config.Metrics{ Enable: true, }, Health: config.Health{ Enable: true, }, }
DefaultHTTPConfig is the default HTTP config.
var DefaultInteropServerConfig = config.InteropServer{ Listen: ":1886", ListenTLS: ":8886", PacketBroker: config.PacketBrokerInteropAuth{ Enabled: false, TokenIssuer: packetbroker.DefaultTokenIssuer, }, }
DefaultInteropServerConfig is the default interop server config.
var DefaultKeyVaultConfig = config.KeyVault{
Provider: "static",
}
DefaultKeyVaultConfig is the default config for key vaults.
var DefaultLogConfig = config.Log{ Format: "console", Level: log.InfoLevel, }
DefaultLogConfig is the default log configuration.
var DefaultOAuthPublicURL = DefaultPublicURL + "/oauth"
DefaultOAuthPublicURL is the default URL where the OAuth API as well as OAuth and Account application frontend is served.
var DefaultPublicHost = "localhost"
DefaultPublicHost is the default public host where The Things Stack is served.
var DefaultPublicURL = "http://" + DefaultPublicHost + ":1885"
DefaultPublicURL is the default public URL where The Things Stack is served.
var DefaultRateLimitingConfig = config.RateLimiting{
Provider: "memory",
}
DefaultRateLimitingConfig is the default config for rate limiting.
var DefaultRedisConfig = redis.Config{ Address: "localhost:6379", Database: 0, RootNamespace: []string{"ttn", "v3"}, }
DefaultRedisConfig is the default config for Redis.
var DefaultRightsConfig = config.Rights{ TTL: 2 * time.Minute, }
DefaultRightsConfig is the default config to fetch rights from the Identity Server.
var DefaultServiceBase = config.ServiceBase{ Base: DefaultBaseConfig, Cluster: DefaultClusterConfig, Cache: DefaultCacheConfig, Redis: DefaultRedisConfig, Events: DefaultEventsConfig, GRPC: DefaultGRPCConfig, HTTP: DefaultHTTPConfig, Interop: DefaultInteropServerConfig, TLS: DefaultTLSConfig, Blob: DefaultBlobConfig, FrequencyPlans: DefaultFrequencyPlansConfig, Rights: DefaultRightsConfig, KeyVault: DefaultKeyVaultConfig, RateLimiting: DefaultRateLimitingConfig, Tracing: DefaultTracingConfig, Telemetry: DefaultTelemetryConfig, TTGC: DefaultTTGCConfig, }
DefaultServiceBase is the default base config for a service.
var DefaultTLSConfig = tlsconfig.Config{ ServerAuth: tlsconfig.ServerAuth{ Certificate: "cert.pem", Key: "key.pem", ACME: tlsconfig.ACME{ Endpoint: acme.LetsEncryptURL, }, }, }
DefaultTLSConfig is the default TLS config.
var DefaultTTGCConfig = ttgc.Config{ GatewayEUIs: []types.EUI64Prefix{ { EUI64: types.EUI64{0xEC, 0x65, 0x6E, 0xFF, 0xFE, 0x00, 0x00, 0x00}, Length: 40, }, }, Address: "gc.thethings.industries:443", TLS: tlsconfig.ClientAuth{ Source: "file", Certificate: "cert.pem", Key: "key.pem", }, }
DefaultTTGCConfig is the default config for The Things Gateway Controller.
var DefaultTelemetryConfig = telemetry.Config{ Enable: true, Target: "https://telemetry.thethingsstack.io/collect", NumConsumers: 1, EntityCountTelemetry: telemetry.EntityCountTelemetry{ Enable: true, Interval: 24 * time.Hour, }, }
DefaultTelemetryConfig is the default config for telemetry.
var DefaultTracingConfig = tracing.Config{ Enable: false, Exporter: "otlp", WriterConfig: tracing.WriterConfig{ Destination: "stderr", }, CollectorConfig: tracing.CollectorConfig{ EndpointURL: "localhost:4317", }, SampleProbability: 1., }
DefaultTracingConfig is the default config for telemetry tracing.
Functions ¶
func InitializeEvents ¶
InitializeEvents initializes the event system.
func InitializeFallbacks ¶ added in v3.9.2
func InitializeFallbacks(conf *config.ServiceBase) error
InitializeFallbacks initializes configuration fallbacks.
Types ¶
type Component ¶ added in v3.18.1
type Component interface { workerpool.Component GetTLSClientConfig(context.Context, ...tlsconfig.Option) (*tls.Config, error) GetPeerConn(ctx context.Context, role ttnpb.ClusterRole, ids cluster.EntityIdentifiers) (*grpc.ClientConn, error) AllowInsecureForCredentials() bool }
Component contains a minimal component.Component definition.