{"modulePath":"github.com/chainloop-dev/chainloop","version":"v1.138.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package server\n\n## Variables\n\n```go\nvar ProviderSet = wire.NewSet(\n\tNewGRPCServers,\n\tNewHTTPServer,\n\tNewHTTPMetricsServer,\n\tNewHTTPProfilerServer,\n\tNewTracerProvider,\n\twire.Struct(new(Opts), \"*\"),\n)\n```\nProviderSet is server providers.\n\n```go\nvar Version = \"dev\"\n```\n\n## Functions\n\n```go\nfunc NewGRPCServer(opts *Opts) (*grpc.Server, error)\n```\nNewGRPCServer builds the native gRPC listener with its existing configuration. A partial TLS configuration keeps this listener plaintext, as it always did.\n\n```go\nfunc NewTracerProvider(c *conf.Bootstrap, logger log.Logger) (trace.TracerProvider, func(), error)\n```\nNewTracerProvider creates an OTel TracerProvider configured from the Bootstrap config. When tracing is disabled or not configured, it returns a noop TracerProvider.\n\n## Types\n\n```go\ntype APIServer struct {\n\t*http.Server\n\t// contains filtered or unexported fields\n}\n```\nAPIServer owns the public HTTP listener and its gRPC handler. The HTTP server must drain before the handler is stopped, so in-flight RPCs finish.\n\n```go\nfunc NewHTTPServer(opts *Opts, grpcServers *GRPCServers) (*APIServer, error)\n```\nNewHTTPServer serves HTTP, gRPC-Web and native gRPC per request on one HTTP/1.1 and HTTP/2 listener, without classifying connections.\n\n```go\nfunc (s *APIServer) Stop(ctx context.Context) error\n```\n\n```go\ntype GRPCServers struct {\n\tHandler *grpc.Server\n\tLegacy  *grpc.Server\n}\n```\nGRPCServers separates the HTTP handler from the optional native listener. Only Legacy must be started as a transport server.\n\n```go\nfunc NewGRPCServers(opts *Opts) (*GRPCServers, error)\n```\nNewGRPCServers assembles the HTTP handler and optional native listener.\n\n```go\ntype HTTPMetricsServer struct {\n\t*http.Server\n}\n```\nHTTPMetricsServer is a HTTP server that exposes the metrics endpoint\n\n```go\nfunc NewHTTPMetricsServer(opts *Opts) (*HTTPMetricsServer, error)\n```\nNewHTTPMetricsServer exposes the metrics endpoint in another port\n\n```go\ntype HTTPProfilerServer struct {\n\t*http.Server\n}\n```\nHTTPProfilerServer 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).\n\n```go\nfunc NewHTTPProfilerServer(_ *Opts) (*HTTPProfilerServer, error)\n```\nNewHTTPProfilerServer exposes the pprof endpoints on a dedicated port.\n\nThe 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.\n\n```go\ntype Opts struct {\n\t// UseCases\n\tAuthzUseCase        *biz.AuthzUseCase\n\tUserUseCase         *biz.UserUseCase\n\tRobotAccountUseCase *biz.RobotAccountUseCase\n\tCASBackendUseCase   *biz.CASBackendUseCase\n\tCASClientUseCase    *biz.CASClientUseCase\n\tIntegrationUseCase  *biz.IntegrationUseCase\n\tReferrerUseCase     *biz.ReferrerUseCase\n\tAPITokenUseCase     *biz.APITokenUseCase\n\tOrganizationUseCase *biz.OrganizationUseCase\n\tWorkflowUseCase     *biz.WorkflowUseCase\n\tMembershipUseCase   *biz.MembershipUseCase\n\tMembershipsCache    cache.Cache[*entities.Membership]\n\tClaimsCache         cache.Cache[*jwt.MapClaims]\n\t// Services\n\tWorkflowSvc         *service.WorkflowService\n\tAuthSvc             *service.AuthService\n\tWorkflowRunSvc      *service.WorkflowRunService\n\tAttestationSvc      *service.AttestationService\n\tWorkflowContractSvc *service.WorkflowContractService\n\tContextSvc          *service.ContextService\n\tCASCredsSvc         *service.CASCredentialsService\n\tOrgMetricsSvc       *service.OrgMetricsService\n\tIntegrationsSvc     *service.IntegrationsService\n\tOrganizationSvc     *service.OrganizationService\n\tCASBackendSvc       *service.CASBackendService\n\tCASRedirectSvc      *service.CASRedirectService\n\tOrgInvitationSvc    *service.OrgInvitationService\n\tReferrerSvc         *service.ReferrerService\n\tAPITokenSvc         *service.APITokenService\n\tAttestationStateSvc *service.AttestationStateService\n\tUserSvc             *service.UserService\n\tSigningSvc          *service.SigningService\n\tPrometheusSvc       *service.PrometheusService\n\tGroupSvc            *service.GroupService\n\tProjectSvc          *service.ProjectService\n\t// Utils\n\tLogger              log.Logger\n\tServerConfig        *conf.Server\n\tAuthConfig          *conf.Auth\n\tFederatedConfig     *conf.FederatedAuthentication\n\tOperationAuthConfig *conf.OperationAuthorizationProvider\n\tBootstrapConfig     *conf.Bootstrap\n\tCredentials         credentials.ReaderWriter\n\tValidator           protovalidate.Validator\n}\n```\n\n","path":"github.com/chainloop-dev/chainloop/app/controlplane/internal/server","name":"server","synopsis":"","isRedistributable":true}
