Skip to content

Commit

Permalink
oci server spec links added to godocs in ocitest.go
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
  • Loading branch information
michael-valdron committed Aug 16, 2022
1 parent e09a610 commit e3b6365
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions index/server/pkg/ocitest/ocitest.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import (
"github.com/gin-gonic/gin"
)

// ResponseError repersents an error returned in an errors response by an OCI server
// ResponseError repersents an error returned in an errors response by an OCI server,
// see https://github.com/opencontainers/distribution-spec/blob/main/spec.md#error-codes
type ResponseError struct {
Code string `json:"code"` // Error code
Message string `json:"message"` // Error Message
Expand All @@ -23,6 +24,8 @@ type ResponseError struct {
// the devfile registry index server endpoint testing,
// however, this entity could be used in a testing scenario
// where an OCI server is needed.
//
// More on the OCI server specification, see https://github.com/opencontainers/distribution-spec/blob/main/spec.md
type MockOCIServer struct {
httpserver *httptest.Server // Test server entity
router *gin.Engine // Router engine for route management
Expand Down Expand Up @@ -71,7 +74,7 @@ func (server *MockOCIServer) Start(listenAddr string) error {
// Testing Route for checking mock OCI server
server.router.GET("/v2/ping", servePing)

// Pull Routes
// Pull Routes, see https://github.com/opencontainers/distribution-spec/blob/main/spec.md#pull
// Fetch manifest routes
if server.ServeManifest != nil {
server.router.GET("/v2/devfile-catalog/:name/manifests/:ref", server.ServeManifest)
Expand Down

0 comments on commit e3b6365

Please sign in to comment.