Help us shape the future of Go! Take the 2026 Go Developer Survey

router

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type APIV1Router

type APIV1Router struct {
	*echo.Group
}

func NewAPIV1Router

func NewAPIV1Router(srv api.Server,
	db shared.DB,
	pool *pgxpool.Pool,
	thirdPartyIntegration shared.IntegrationAggregate,
	oryAdmin shared.AdminClient,
	configService shared.ConfigService,
	assetController *controllers.AssetController,
	intotoController *controllers.InToToController,
	csafController *controllers.CSAFController,
	scanController *controllers.ScanController,
	dependencyVulnController *controllers.DependencyVulnController,
	orgRepository shared.OrganizationRepository,
	projectRepository shared.ProjectRepository,
	assetRepository shared.AssetRepository,
	assetVersionRepository shared.AssetVersionRepository,
	artifactRepository shared.ArtifactRepository,
) APIV1Router

type APIV2Router added in v1.6.0

type APIV2Router struct {
	*echo.Group
}

func NewAPIV2Router added in v1.6.0

func NewAPIV2Router(
	srv api.Server,
	oryAdmin shared.AdminClient,
	adminClient shared.PublicClient,
	patService shared.PersonalAccessTokenService,
	externalEntityProviderService shared.ExternalEntityProviderService,
	thirdPartyIntegration shared.IntegrationAggregate,
	scanController *controllers.ScanController,
	assetRepository shared.AssetRepository,
	projectRepository shared.ProjectRepository,
	assetVersionRepository shared.AssetVersionRepository,
	casbinRBACProvider shared.RBACProvider,
	orgService shared.OrgService,
	configService shared.ConfigService,
	gitlabOauth2Integrations map[string]*gitlabint.GitlabOauth2Config,
) APIV2Router

type AdminRouter added in v1.6.1

type AdminRouter struct {
	*echo.Group
}

func NewAdminRouter added in v1.6.1

func NewAdminRouter(apiV1Router APIV1Router, adminController *controllers.AdminController, patService shared.PersonalAccessTokenService) AdminRouter

type ArtifactRouter

type ArtifactRouter struct {
	*echo.Group
}

func NewArtifactRouter

func NewArtifactRouter(
	assetVersionGroup AssetVersionRouter,
	artifactController *controllers.ArtifactController,
	assetController *controllers.AssetController,
	externalReferenceController *controllers.ExternalReferenceController,
	artifactRepository shared.ArtifactRepository,
	assetRepository shared.AssetRepository,
) ArtifactRouter

type AssetRouter

type AssetRouter struct {
	*echo.Group
}

func NewAssetRouter

func NewAssetRouter(
	projectGroup ProjectRouter,
	assetController *controllers.AssetController,
	dependencyProxyController *dependencyfirewall.DependencyProxyController,
	assetVersionController *controllers.AssetVersionController,
	complianceController *controllers.ComplianceController,
	statisticsController *controllers.StatisticsController,
	componentController *controllers.ComponentController,
	intotoController *controllers.InToToController,
	integrationController *controllers.IntegrationController,
	scanController *controllers.ScanController,
	assetRepository shared.AssetRepository,
) AssetRouter

type AssetVersionRouter

type AssetVersionRouter struct {
	*echo.Group
}

func NewAssetVersionRouter

func NewAssetVersionRouter(
	assetGroup AssetRouter,
	assetVersionController *controllers.AssetVersionController,
	firstPartyVulnController *controllers.FirstPartyVulnController,
	complianceController *controllers.ComplianceController,
	componentController *controllers.ComponentController,
	statisticsController *controllers.StatisticsController,
	attestationController *controllers.AttestationController,
	intotoController *controllers.InToToController,
	vulnEventController *controllers.VulnEventController,
	artifactController *controllers.ArtifactController,
	externalReferenceController *controllers.ExternalReferenceController,
	assetVersionRepository shared.AssetVersionRepository,
	assetRepository shared.AssetRepository,
	vulnEventRepository shared.VulnEventRepository,
) AssetVersionRouter

type BuildInfo

type BuildInfo struct {
	Version   string `json:"version,omitempty"`
	Commit    string `json:"commit,omitempty"`
	Branch    string `json:"branch,omitempty"`
	BuildDate string `json:"buildDate,omitempty"`
}

BuildInfo holds compiled build metadata

type CrowdsourcedVexingRouter added in v1.4.0

type CrowdsourcedVexingRouter struct {
	*echo.Group
}

func NewCrowdsourcedVexingRouter added in v1.4.0

func NewCrowdsourcedVexingRouter(
	assetVersionRouter AssetVersionRouter,
	crowdsourcedVexingController *controllers.CrowdsourcedVexingController,
) CrowdsourcedVexingRouter

type DBStats added in v1.6.1

type DBStats struct {
	MaxOpenConnections int `json:"maxOpenConnections,omitempty"`

	// Pool Status
	OpenConnections int `json:"openConnections,omitempty"` // The number of established connections both in use and idle.
	InUse           int `json:"inUse,omitempty"`           // The number of connections currently in use.
	Idle            int `json:"idle,omitempty"`            // The number of idle connections.

	// Counters
	WaitCount         int64         `json:"waitCount,omitempty"`         // The total number of connections waited for.
	WaitDuration      time.Duration `json:"waitDuration,omitempty"`      // The total time blocked waiting for a new connection.
	MaxIdleClosed     int64         `json:"maxIdleClosed,omitempty"`     // The total number of connections closed due to SetMaxIdleConns.
	MaxIdleTimeClosed int64         `json:"maxIdleTimeClosed,omitempty"` // The total number of connections closed due to SetConnMaxIdleTime.
	MaxLifetimeClosed int64         `json:"maxLifetimeClosed,omitempty"` // The total number of connections closed due to SetConnMaxLifetime.
}

type DatabaseInfo

type DatabaseInfo struct {
	DBStats
	Status string  `json:"status"`
	Error  *string `json:"error,omitempty"`

	MigrationVersion *uint   `json:"migrationVersion,omitempty"`
	MigrationDirty   *bool   `json:"migrationDirty,omitempty"`
	MigrationError   *string `json:"migrationError,omitempty"`

	VulnDBVersion *string `json:"vulndbVersion,omitempty"`

	Pool *PoolInfo `json:"pool,omitempty"`
}

DatabaseInfo describes DB connectivity and migration/vulndb metadata

type DependencyProxyRouter

type DependencyProxyRouter struct {
	*echo.Group
}

type DependencyVulnRouter

type DependencyVulnRouter struct {
	*echo.Group
}

func NewDependencyVulnRouter

func NewDependencyVulnRouter(
	assetVersionGroup AssetVersionRouter,
	dependencyVulnController *controllers.DependencyVulnController,
	vulnEventController *controllers.VulnEventController,

) DependencyVulnRouter

type ExternalReferenceRouter

type ExternalReferenceRouter struct {
	*echo.Group
}

func NewExternalReferenceRouter

func NewExternalReferenceRouter(
	assetVersionRouter AssetVersionRouter,
	externalReferenceController *controllers.ExternalReferenceController,
	assetRepository shared.AssetRepository,
) ExternalReferenceRouter

type FirstPartyVulnRouter

type FirstPartyVulnRouter struct {
	*echo.Group
}

func NewFirstPartyVulnRouter

func NewFirstPartyVulnRouter(
	assetVersionGroup AssetVersionRouter,
	firstPartyVulnController *controllers.FirstPartyVulnController,
	vulnEventController *controllers.VulnEventController,
) FirstPartyVulnRouter

type InfoResponse

type InfoResponse struct {
	Build    BuildInfo    `json:"build"`
	Process  ProcessInfo  `json:"process"`
	Runtime  RuntimeInfo  `json:"runtime"`
	Database DatabaseInfo `json:"database"`
}

InfoResponse is the typed response returned by the /api/v1/info/ endpoint. It is structured for readable inspection by humans and machines.

type LicenseRiskRouter

type LicenseRiskRouter struct {
	*echo.Group
}

func NewLicenseRiskRouter

func NewLicenseRiskRouter(
	assetVersionGroup AssetVersionRouter,
	licenseRiskController *controllers.LicenseRiskController,
) LicenseRiskRouter

type MemStats

type MemStats struct {
	Alloc      uint64 `json:"alloc"`
	TotalAlloc uint64 `json:"totalAlloc"`
	Sys        uint64 `json:"sys"`
	HeapAlloc  uint64 `json:"heapAlloc"`
}

MemStats focuses on a small, relevant subset of runtime.MemStats

type OCIRegistryRouter added in v1.3.0

type OCIRegistryRouter struct {
	*echo.Group
}

OCIRegistryRouter exposes the OCI Distribution Spec v2 API at the root /v2/ path so that standard Docker clients can pull images without any special configuration.

Unauthenticated (no custom firewall rules applied):

docker pull <host>/docker.io/library/nginx:latest

Secret-scoped (custom rules and MinReleaseAge enforced):

docker pull <host>/<secret>/docker.io/library/nginx:latest

Docker resolves these as registry=<host> and sends:

GET /v2/                                                       (version check)
GET /v2/docker.io/library/nginx/manifests/latest               (unauthenticated)
GET /v2/<secret>/docker.io/library/nginx/manifests/latest      (secret-scoped)

Routing note: to avoid ambiguity, no-secret routes cover 1- and 2-segment image names while secret routes cover 2- and 3-segment image names (shifted by one). In practice this means all real Docker Hub and ghcr.io images (e.g. library/nginx, org/repo) work in both modes.

func NewOCIRegistryRouter added in v1.3.0

func NewOCIRegistryRouter(srv api.Server, ociController *dependencyfirewall.OCIDependencyProxyController) OCIRegistryRouter

type OrgRouter

type OrgRouter struct {
	*echo.Group
}

func NewOrgRouter

func NewOrgRouter(
	sessionGroup SessionRouter,
	configService shared.ConfigService,
	orgController *controllers.OrgController,
	projectController *controllers.ProjectController,
	dependencyProxyController *dependencyfirewall.DependencyProxyController,
	dependencyVulnController *controllers.DependencyVulnController,
	firstPartyVulnController *controllers.FirstPartyVulnController,
	policyController *controllers.PolicyController,
	integrationController *controllers.IntegrationController,
	webhookIntegration *controllers.WebhookController,
	externalEntityProviderService shared.ExternalEntityProviderService,
	orgService shared.OrgService,
	gitlabOauth2Integrations map[string]*gitlabint.GitlabOauth2Config,
	casbinRBACProvider shared.RBACProvider,
	statisticsController *controllers.StatisticsController,
) OrgRouter

type PoolInfo

type PoolInfo struct {
	DBName          string `json:"dbName,omitempty"`
	MaxOpenConns    int32  `json:"maxOpenConns,omitempty"`
	ConnMaxLifetime string `json:"connMaxLifetime,omitempty"`
	ConnMaxIdleTime string `json:"connMaxIdleTime,omitempty"`

	// Runtime pool statistics taken from pgxpool.Stat()
	TotalConns    int `json:"totalConns,omitempty"`
	IdleConns     int `json:"idleConns,omitempty"`
	AcquiredConns int `json:"acquiredConns,omitempty"`
	MaxConns      int `json:"maxConns,omitempty"`
}

PoolInfo exposes non-sensitive pool configuration used by the application. Note: sensitive information (passwords) is intentionally omitted.

type ProcessInfo

type ProcessInfo struct {
	PID           int    `json:"pid"`
	Hostname      string `json:"hostname,omitempty"`
	UptimeSeconds int    `json:"uptimeSeconds"`
}

ProcessInfo holds process-level diagnostics

type ProjectRouter

type ProjectRouter struct {
	*echo.Group
}

func NewProjectRouter

func NewProjectRouter(
	organizationGroup OrgRouter,
	projectController *controllers.ProjectController,
	assetController *controllers.AssetController,
	dependencyProxyController *dependencyfirewall.DependencyProxyController,
	dependencyVulnController *controllers.DependencyVulnController,
	policyController *controllers.PolicyController,
	releaseController *controllers.ReleaseController,
	statisticsController *controllers.StatisticsController,
	webhookIntegration *controllers.WebhookController,
	projectRepository shared.ProjectRepository,
	componentController *controllers.ComponentController,
	gitlabIntegrations map[string]*gitlabint.GitlabOauth2Config,
) ProjectRouter

type RuntimeInfo

type RuntimeInfo struct {
	GoVersion     string   `json:"goVersion,omitempty"`
	NumGoroutines int      `json:"numGoroutines,omitempty"`
	Mem           MemStats `json:"mem"`
}

RuntimeInfo aggregates Go runtime diagnostics

type SessionRouter

type SessionRouter struct {
	*echo.Group
}

func NewSessionRouter

func NewSessionRouter(
	apiV1Router APIV1Router,
	adminClient shared.PublicClient,
	configService shared.ConfigService,
	patService shared.PersonalAccessTokenService,
	externalEntityProviderService shared.ExternalEntityProviderService,
	integrationController *controllers.IntegrationController,
	orgController *controllers.OrgController,
	scanController *controllers.ScanController,
	attestationController *controllers.AttestationController,
	patController *controllers.PatController,
	assetRepository shared.AssetRepository,
	projectRepository shared.ProjectRepository,
	casbinRBACProvider shared.RBACProvider,
	orgService shared.OrgService,
	assetVersionRepository shared.AssetVersionRepository,
) SessionRouter

type ShareRouter

type ShareRouter struct {
	*echo.Group
}

func NewShareRouter

func NewShareRouter(apiV1Router APIV1Router,
	assetController *controllers.AssetController,
	orgRepository shared.OrganizationRepository,
	projectRepository shared.ProjectRepository,
	assetRepository shared.AssetRepository,
	assetVersionRepository shared.AssetVersionRepository,
	artifactRepository shared.ArtifactRepository,
	artifactController *controllers.ArtifactController,
) ShareRouter

type VEXRuleRouter

type VEXRuleRouter struct {
	*echo.Group
}

func NewVEXRuleRouter

func NewVEXRuleRouter(
	assetVersionRouter AssetVersionRouter,
	vexRuleController *controllers.VEXRuleController,
) VEXRuleRouter

type VulnDBRouter

type VulnDBRouter struct {
	Group *echo.Group
}

func NewVulnDBRouter

func NewVulnDBRouter(apiV1Router APIV1Router, vulndbController *controllers.VulnDBController) VulnDBRouter

Jump to

Keyboard shortcuts

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