server

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLoggerToCtxMiddleware added in v0.6.0

func AddLoggerToCtxMiddleware(next http.Handler) http.Handler

Adds the logger to the http request context

func GetDepsForArtifact added in v0.14.0

func GetDepsForArtifact(
	ctx context.Context,
	gqlClient graphql.Client,
	digest string,
) (map[string]string, error)

GetDepsForArtifact gets all direct and transitive dependencies for a digest

func GetDepsForPackage added in v0.14.0

func GetDepsForPackage(
	ctx context.Context,
	gqlClient graphql.Client,
	purl string,
) (map[string]string, error)

GetDepsForPackage gets all direct and transitive dependencies for a given purl

func IsErrorResponse added in v0.14.0

func IsErrorResponse(statusCode int) bool

IsErrorResponse checks if the response status code indicates an error.

func IsSuccessResponse added in v0.14.0

func IsSuccessResponse(statusCode int) bool

IsSuccessResponse checks if the response status code indicates success.

func LogRequestsMiddleware added in v0.6.0

func LogRequestsMiddleware(next http.Handler) http.Handler

Logs data for a request and its response. The request context should already contain the logger.

Types

type DefaultServer

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

DefaultServer implements the API, backed by the GraphQL Server

func NewDefaultServer

func NewDefaultServer(gqlClient graphql.Client) *DefaultServer

func (*DefaultServer) GetArtifactDeps added in v0.14.0

func (*DefaultServer) GetArtifactVulns added in v0.14.0

func (*DefaultServer) GetPackageDeps added in v0.14.0

func (*DefaultServer) GetPackagePurls added in v0.14.0

func (*DefaultServer) GetPackageVulns added in v0.14.0

func (*DefaultServer) HealthCheck

type EndpointType added in v0.14.0

type EndpointType int

Define a custom type for endpoint types

const (
	GetPackagePurls EndpointType = iota
	GetPackageVulns
	GetPackageDeps
	GetArtifactVulns
	GetArtifactDeps
)

type EntConnectedServer added in v0.8.0

type EntConnectedServer struct {
	*DefaultServer
	// contains filtered or unexported fields
}

EntConnectedServer implements the REST API interface, using by default the GrapQL API Server as a backend, but also allows overriding the default handlers to ones that directly use the ENT backend.

This is an experimental feature.

func NewEntConnectedServer added in v0.8.0

func NewEntConnectedServer(ent *ent.Client, gqlClient graphql.Client) *EntConnectedServer

Jump to

Keyboard shortcuts

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