Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ProviderSet = wire.NewSet( NewGRPCServers, NewHTTPServer, NewHTTPMetricsServer, NewHTTPProfilerServer, NewTracerProvider, wire.Struct(new(Opts), "*"), )
ProviderSet is server providers.
var Version = "dev"
Functions ¶
func NewGRPCServer ¶
NewGRPCServer builds the native gRPC listener with its existing configuration. A partial TLS configuration keeps this listener plaintext, as it always did.
func NewTracerProvider ¶ added in v1.95.2
NewTracerProvider creates an OTel TracerProvider configured from the Bootstrap config. When tracing is disabled or not configured, it returns a noop TracerProvider.
Types ¶
type APIServer ¶ added in v1.126.0
APIServer owns the public HTTP listener and its gRPC handler. The HTTP server must drain before the handler is stopped, so in-flight RPCs finish.
func NewHTTPServer ¶
func NewHTTPServer(opts *Opts, grpcServers *GRPCServers) (*APIServer, error)
NewHTTPServer serves HTTP, gRPC-Web and native gRPC per request on one HTTP/1.1 and HTTP/2 listener, without classifying connections.
type GRPCServers ¶ added in v1.126.0
GRPCServers separates the HTTP handler from the optional native listener. Only Legacy must be started as a transport server.
func NewGRPCServers ¶ added in v1.126.0
func NewGRPCServers(opts *Opts) (*GRPCServers, error)
NewGRPCServers assembles the HTTP handler and optional native listener.
type HTTPMetricsServer ¶
HTTPMetricsServer is a HTTP server that exposes the metrics endpoint
func NewHTTPMetricsServer ¶
func NewHTTPMetricsServer(opts *Opts) (*HTTPMetricsServer, error)
NewHTTPMetricsServer exposes the metrics endpoint in another port
type HTTPProfilerServer ¶ added in v0.114.0
HTTPProfilerServer is an opt-in HTTP server that exposes the Go pprof endpoints on a dedicated port. It is only started when profiling is explicitly enabled via configuration (enable_profiler).
func NewHTTPProfilerServer ¶ added in v0.114.0
func NewHTTPProfilerServer(_ *Opts) (*HTTPProfilerServer, error)
NewHTTPProfilerServer exposes the pprof endpoints on a dedicated port.
The pprof handlers are registered explicitly on this server's own router, instead of relying on the process-wide http.DefaultServeMux. Combined with hardenedRouteOptions (which prevents every other kratos server from falling back to that default mux), this keeps the unauthenticated /debug/pprof/* endpoints off the public API and metrics listeners.
type Opts ¶
type Opts struct {
// UseCases
AuthzUseCase *biz.AuthzUseCase
UserUseCase *biz.UserUseCase
RobotAccountUseCase *biz.RobotAccountUseCase
CASBackendUseCase *biz.CASBackendUseCase
CASClientUseCase *biz.CASClientUseCase
IntegrationUseCase *biz.IntegrationUseCase
ReferrerUseCase *biz.ReferrerUseCase
APITokenUseCase *biz.APITokenUseCase
OrganizationUseCase *biz.OrganizationUseCase
WorkflowUseCase *biz.WorkflowUseCase
MembershipUseCase *biz.MembershipUseCase
MembershipsCache cache.Cache[*entities.Membership]
ClaimsCache cache.Cache[*jwt.MapClaims]
// Services
WorkflowSvc *service.WorkflowService
AuthSvc *service.AuthService
WorkflowRunSvc *service.WorkflowRunService
AttestationSvc *service.AttestationService
WorkflowContractSvc *service.WorkflowContractService
ContextSvc *service.ContextService
CASCredsSvc *service.CASCredentialsService
OrgMetricsSvc *service.OrgMetricsService
IntegrationsSvc *service.IntegrationsService
OrganizationSvc *service.OrganizationService
CASBackendSvc *service.CASBackendService
CASRedirectSvc *service.CASRedirectService
OrgInvitationSvc *service.OrgInvitationService
ReferrerSvc *service.ReferrerService
APITokenSvc *service.APITokenService
AttestationStateSvc *service.AttestationStateService
UserSvc *service.UserService
SigningSvc *service.SigningService
PrometheusSvc *service.PrometheusService
GroupSvc *service.GroupService
ProjectSvc *service.ProjectService
// Utils
Logger log.Logger
ServerConfig *conf.Server
AuthConfig *conf.Auth
FederatedConfig *conf.FederatedAuthentication
OperationAuthConfig *conf.OperationAuthorizationProvider
BootstrapConfig *conf.Bootstrap
Credentials credentials.ReaderWriter
Validator protovalidate.Validator
}