server

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(
	cfg *config.Config,
	services *handlers.Services,
	scipSvc *scip.Service,
	logger *zap.Logger,
) *http.Server

New creates a new HTTP server with all routes configured.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder provides a fluent API for constructing the HTTP server with optional enterprise extension points. This is the primary integration surface for the enterprise repository.

func NewBuilder

func NewBuilder(cfg *config.Config, services *handlers.Services, logger *zap.Logger) *Builder

NewBuilder creates a server builder with the required dependencies.

func (*Builder) Build

func (b *Builder) Build() *http.Server

Build creates the configured HTTP server.

func (*Builder) WithAuditLogger

func (b *Builder) WithAuditLogger(al audit.AuditLogger) *Builder

WithAuditLogger sets a custom audit logger for compliance logging. If not called, the default NoOpAuditLogger is used.

func (*Builder) WithAuthenticator

func (b *Builder) WithAuthenticator(auth authmw.Authenticator) *Builder

WithAuthenticator sets a custom authenticator (e.g., SAML, OIDC). If not called, the default NoOpAuthenticator is used.

func (*Builder) WithAuthorizer

func (b *Builder) WithAuthorizer(authz authmw.Authorizer) *Builder

WithAuthorizer sets a custom authorizer (e.g., RBAC). If not called, the default NoOpAuthorizer is used.

func (*Builder) WithRoutes

func (b *Builder) WithRoutes(fn func(chi.Router)) *Builder

WithRoutes adds a function that registers additional routes on the router. This allows enterprise to add auth, admin, and other routes to the same server without modifying the core router setup.

func (*Builder) WithSCIP

func (b *Builder) WithSCIP(svc *scip.Service) *Builder

WithSCIP sets the SCIP service for precise code navigation.

func (*Builder) WithSearchResultFilter

func (b *Builder) WithSearchResultFilter(fn func(ctx context.Context, results []search.SearchResult) []search.SearchResult) *Builder

WithSearchResultFilter sets a function to filter search results based on user access. This is a convenience that wraps authorizer-level filtering into the search pipeline.

Jump to

Keyboard shortcuts

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