shared

package
v3.32.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
var DefaultAssetsBaseURL = DefaultHTTPConfig.Static.Mount

DefaultAssetsBaseURL is the default public URL where the assets are served.

View Source
var DefaultBaseConfig = config.Base{
	Log: DefaultLogConfig,
}

DefaultBaseConfig is the default base component configuration.

View Source
var DefaultBlobConfig = config.BlobConfig{
	Provider: "local",
	Local: config.BlobConfigLocal{
		Directory: "./public/blob",
	},
}

DefaultBlobConfig is the default config for the blob store.

View Source
var DefaultCacheConfig = config.Cache{
	Redis: DefaultRedisConfig,
}

DefaultCacheConfig is the default cache configuration.

View Source
var DefaultClusterConfig = cluster.Config{}

DefaultClusterConfig is the default cluster configuration.

View Source
var DefaultConsolePublicURL = DefaultPublicURL + "/console"

DefaultConsolePublicURL is the default public URL where the Console is served.

View Source
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.

View Source
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.

View Source
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.

View Source
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.

View Source
var DefaultInteropServerConfig = config.InteropServer{
	Listen:    ":1886",
	ListenTLS: ":8886",
	PacketBroker: config.PacketBrokerInteropAuth{
		Enabled:     false,
		TokenIssuer: packetbroker.DefaultTokenIssuer,
	},
}

DefaultInteropServerConfig is the default interop server config.

View Source
var DefaultKeyVaultConfig = config.KeyVault{
	Provider: "static",
}

DefaultKeyVaultConfig is the default config for key vaults.

View Source
var DefaultLogConfig = config.Log{
	Format: "console",
	Level:  log.InfoLevel,
}

DefaultLogConfig is the default log configuration.

View Source
var DefaultOAuthPublicURL = DefaultPublicURL + "/oauth"

DefaultOAuthPublicURL is the default URL where the OAuth API as well as OAuth and Account application frontend is served.

View Source
var DefaultPublicHost = "localhost"

DefaultPublicHost is the default public host where The Things Stack is served.

View Source
var DefaultPublicURL = "http://" + DefaultPublicHost + ":1885"

DefaultPublicURL is the default public URL where The Things Stack is served.

View Source
var DefaultRateLimitingConfig = config.RateLimiting{
	Provider: "memory",
}

DefaultRateLimitingConfig is the default config for rate limiting.

View Source
var DefaultRedisConfig = redis.Config{
	Address:       "localhost:6379",
	Database:      0,
	RootNamespace: []string{"ttn", "v3"},
}

DefaultRedisConfig is the default config for Redis.

View Source
var DefaultRightsConfig = config.Rights{
	TTL: 2 * time.Minute,
}

DefaultRightsConfig is the default config to fetch rights from the Identity Server.

DefaultServiceBase is the default base config for a service.

View Source
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.

View Source
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.

View Source
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.

View Source
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

func InitializeEvents(ctx context.Context, component Component, conf config.ServiceBase) error

InitializeEvents initializes the event system.

func InitializeFallbacks added in v3.9.2

func InitializeFallbacks(conf *config.ServiceBase) error

InitializeFallbacks initializes configuration fallbacks.

func InitializeLogger added in v3.13.2

func InitializeLogger(conf *config.Log) (log.Stack, error)

InitializeLogger initializes the logger.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL