api

package
v0.30.8 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderContentType = "Content-Type"
	HeaderAccept      = "Accept"
)

Variables

View Source
var MimeTypeDockerImageManifestV2 = MimeType{Type: "application", Subtype: "vnd.docker.distribution.manifest.v2+json"}
View Source
var MimeTypeError = MimeType{Type: "application", Subtype: "vnd.scanner.adapter.error", Params: MimeTypeVersion}
View Source
var MimeTypeMetadata = MimeType{Type: "application", Subtype: "vnd.scanner.adapter.metadata+json", Params: MimeTypeVersion}
View Source
var MimeTypeOCIImageManifest = MimeType{Type: "application", Subtype: "vnd.oci.image.manifest.v1+json"}
View Source
var MimeTypeScanResponse = MimeType{Type: "application", Subtype: "vnd.scanner.adapter.scan.response+json", Params: MimeTypeVersion}
View Source
var MimeTypeSecurityVulnerabilityReport = MimeType{Type: "application", Subtype: "vnd.security.vulnerability.report", Params: map[string]string{"version": "1.1"}}
View Source
var MimeTypeVersion = map[string]string{"version": "1.0"}

Functions

This section is empty.

Types

type BaseHandler

type BaseHandler struct {
}

func (*BaseHandler) SendInternalServerError

func (h *BaseHandler) SendInternalServerError(res http.ResponseWriter)

func (*BaseHandler) WriteJSON

func (h *BaseHandler) WriteJSON(res http.ResponseWriter, data interface{}, mimeType MimeType, statusCode int)

func (*BaseHandler) WriteJSONError

func (h *BaseHandler) WriteJSONError(res http.ResponseWriter, err harbor.Error)

type MimeType

type MimeType struct {
	Type    string
	Subtype string
	Params  MimeTypeParams
}

func (*MimeType) FromAcceptHeader added in v0.17.0

func (mt *MimeType) FromAcceptHeader(value string) error

func (MimeType) String

func (mt MimeType) String() string

type MimeTypeParams

type MimeTypeParams map[string]string

type Server

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

func NewServer

func NewServer(config etc.API, handler http.Handler) (server *Server, err error)

func (*Server) ListenAndServe

func (s *Server) ListenAndServe()

func (*Server) Shutdown

func (s *Server) Shutdown()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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