Documentation ¶
Index ¶
- Variables
- type AuthServiceParams
- type AuthServiceResult
- type ConnectionMuxParams
- type ConnectionMuxResult
- type GatewayServiceParams
- type GatewayServiceResult
- type GrpcServiceParams
- type GrpcServiceResult
- type OTelProviderParams
- type OTelProviderResult
- type SecuritySettingsParams
- type SecuritySettingsResult
- type SettingsParams
- type SettingsResult
- type ZinxServiceParams
- type ZinxServiceResult
Constants ¶
This section is empty.
Variables ¶
View Source
var ConnectionMuxModule = fx.Provide( func(l *zap.Logger, g SettingsParams, s SecuritySettingsParams) (out ConnectionMuxResult, err error) { err = out.Execute(l, g, s) return }, )
View Source
var OTelModule = fx.Provide( func( appSetting mfx.AppParams, sSetting SettingsParams, ) (out OTelProviderResult, err error) { err = out.Execute(appSetting, sSetting.OtelEnable) return }, )
View Source
var SecuritySettingsModule = fx.Provide( func() (out SecuritySettingsResult, err error) { err = out.LoadFromEnv() return }, )
View Source
var SettingsModule = fx.Provide( func() (out SettingsResult, err error) { err = out.LoadFromEnv() return }, )
Functions ¶
This section is empty.
Types ¶
type AuthServiceParams ¶
type AuthServiceResult ¶
type ConnectionMuxParams ¶
type ConnectionMuxParams struct { fx.In ConnectionMux siface.IConnectionMux `name:"ConnectionMux"` }
type ConnectionMuxResult ¶
type ConnectionMuxResult struct { fx.Out ConnectionMux siface.IConnectionMux `name:"ConnectionMux"` }
func (*ConnectionMuxResult) Execute ¶
func (cmr *ConnectionMuxResult) Execute( l *zap.Logger, g SettingsParams, s SecuritySettingsParams, ) (err error)
type GatewayServiceParams ¶
type GatewayServiceParams struct { fx.In GatewayServices []siface.IGatewayService `group:"GatewayService"` }
type GatewayServiceResult ¶
type GatewayServiceResult struct { fx.Out GatewayService siface.IGatewayService `group:"GatewayService"` }
type GrpcServiceParams ¶
type GrpcServiceParams struct { fx.In GrpcServices []siface.IGrpcService `group:"GrpcService"` }
type GrpcServiceResult ¶
type GrpcServiceResult struct { fx.Out GrpcService siface.IGrpcService `group:"GrpcService"` }
type OTelProviderParams ¶ added in v0.0.32
type OTelProviderParams struct { fx.In TracerProvider *sdktrace.TracerProvider `name:"TracerProvider" optional:"true"` MetricProvider *sdkmetric.MeterProvider `name:"MetricProvider" optional:"true"` }
OTelProviderParams OTelProviderModule provides OTel Tracer and Meter
type OTelProviderResult ¶ added in v0.0.32
type OTelProviderResult struct { fx.Out TracerProvider *sdktrace.TracerProvider `name:"TracerProvider" ` MetricProvider *sdkmetric.MeterProvider `name:"MetricProvider"` }
OTelProviderResult OTelProviderModule provides OTel Tracer and Meter
type SecuritySettingsParams ¶
type SecuritySettingsParams struct { fx.In // client mTLS settings ClientCaCert string `name:"ClientCaCert"` ClientCert string `name:"ClientCert"` ClientKey string `name:"ClientKey"` // server mTLS settings ServerCaCert string `name:"ServerCaCert"` ServerCert string `name:"ServerCert"` ServerKey string `name:"ServerKey"` ServerName string `name:"ServerName"` // Zero trust security model: all services must be mTLS enabled // if true, enable imports client for grpc/http(cmux service) clients MTLSEnable bool `name:"MTLSEnable"` // if true, enable service tls for grpc/http(cmux service) services TLSEnable bool `name:"TLSEnable"` // if true, enable Tls for tcp services(zinx service) TCPTlsEnable bool `name:"TCPTlsEnable"` }
type SecuritySettingsResult ¶
type SecuritySettingsResult struct { fx.Out //client mTLS settings ClientCaCert string `name:"ClientCaCert" envconfig:"CLIENT_CA_CERT" default:"./configs/tls-client/ca.crt"` ClientCert string `name:"ClientCert" envconfig:"CLIENT_CERT" default:"./configs/tls-client/tls.crt"` ClientKey string `name:"ClientKey" envconfig:"CLIENT_KEY" default:"./configs/tls-client/tls.key"` //server mTLS settings ServerCACert string `name:"ServerCaCert" envconfig:"SERVER_CA_CERT" default:"./configs/tls-server/ca.crt"` ServerCert string `name:"ServerCert" envconfig:"SERVER_CERT" default:"./configs/tls-server/tls.crt"` ServerKey string `name:"ServerKey" envconfig:"SERVER_KEY" default:"./configs/tls-server/tls.key"` ServerName string `name:"ServerName" envconfig:"SERVER_NAME" default:""` // if true, enable mTLS for grpc/http(cmux service) services // Zero trust security model: all services must be mTLS enabled MTLSEnable bool `name:"MTLSEnable" envconfig:"MTLS_ENABLE" default:"false"` // if true, enable service tls for grpc/http(cmux service) services TLSEnable bool `name:"TLSEnable" envconfig:"TLS_ENABLE" default:"false"` // if true, enable Tls for tcp services(zinx service) TcpTlsEnable bool `name:"TCPTlsEnable" envconfig:"TCP_TLS_ENABLE" default:"false"` }
func (*SecuritySettingsResult) LoadFromEnv ¶
func (g *SecuritySettingsResult) LoadFromEnv() (err error)
type SettingsParams ¶
type SettingsParams struct { fx.In Port int32 `name:"Port"` // grpc/http port Timeout int32 `name:"Timeout"` // tcp service heartbeat timeout RateLimit int32 `name:"RateLimit"` // all server type rate limit per second OtelEnable bool `name:"OtelEnable"` // open telemetry enable //--------------------- zinx settings --------------------- // pure tcp port ZinxTcpPort int32 `name:"ZinxTcpPort"` // tcp port // websocket port ZinxWSPort int32 `name:"ZinxWSPort"` // websocket port // The maximum size of the packets that can be sent or received MaxPacketSize uint32 `name:"MaxPacketSize"` // The number of worker pools in the business logic WorkerPoolSize uint32 `name:"WorkerPoolSize"` // The maximum number of tasks that a worker pool can handle MaxWorkerTaskLen uint32 `name:"MaxWorkerTaskLen"` // The maximum length of the send buffer message queue MaxMsgChanLen uint32 `name:"MaxMsgChanLen"` }
SettingsParams All server settings module
type SettingsResult ¶
type SettingsResult struct { fx.Out Port int32 `name:"Port" envconfig:"PORT" default:"8081"` Timeout int32 `name:"Timeout" envconfig:"TIMEOUT" default:"10"` RateLimit int32 `name:"RateLimit" envconfig:"RATE_LIMIT" default:"1000"` OtelEnable bool `name:"OtelEnable" envconfig:"OTEL_ENABLE" default:"false"` // --------------------- zinx settings --------------------- ZinxTcpPort int32 `name:"ZinxTcpPort" envconfig:"ZINX_TCP_PORT" default:"8888"` // websocket port ZinxWSPort int32 `name:"ZinxWSPort" envconfig:"ZINX_WS_PORT" default:""` // The maximum size of the packets that can be sent or received MaxPacketSize uint32 `name:"MaxPacketSize" envconfig:"MAX_PACKET_SIZE" default:"4096"` // The number of worker pools in the business logic WorkerPoolSize uint32 `name:"WorkerPoolSize" envconfig:"WORKER_POOL_SIZE" default:"64"` // The maximum number of tasks that a worker pool can handle MaxWorkerTaskLen uint32 `name:"MaxWorkerTaskLen" envconfig:"MAX_WORKER_TASK_LEN" default:"1024"` // The maximum length of the send buffer message queue MaxMsgChanLen uint32 `name:"MaxMsgChanLen" envconfig:"MAX_MSG_CHAN_LEN" default:"1024"` }
SettingsResult loads from the environment and its members are injected into the tfx dependency graph.
func (*SettingsResult) LoadFromEnv ¶
func (g *SettingsResult) LoadFromEnv() (err error)
type ZinxServiceParams ¶
type ZinxServiceParams struct { fx.In ZinxServices []siface.IZinxService `group:"ZinxService"` }
type ZinxServiceResult ¶
type ZinxServiceResult struct { fx.Out ZinxService siface.IZinxService `group:"ZinxService"` }
Click to show internal directories.
Click to hide internal directories.