mirror of
https://github.com/harness/drone.git
synced 2025-05-05 23:42:57 +00:00
* feat:[AH-1093]: NPM search package support * Merge branch 'main' of https://git0.harness.io/l7B_kbSEQD2wjrM7PShm5w/PROD/Harness_Commons/gitness * Merge branch 'main' of https://git0.harness.io/l7B_kbSEQD2wjrM7PShm5w/PROD/Harness_Commons/gitness * Merge branch 'main' of https://git0.harness.io/l7B_kbSEQD2wjrM7PShm5w/PROD/Harness_Commons/gitness * Merge branch 'release/registry-api_1.18.0' of https://git0.harness.io/l7B_kbSEQD2wjrM7PShm5w/PROD/Harness_Commons/gitness * feat:[AH-1083]: url fix (#3669) * feat:[AH-1083]: url fix
93 lines
1.9 KiB
Go
93 lines
1.9 KiB
Go
// Copyright 2023 Harness, Inc.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
package npm
|
|
|
|
import (
|
|
"io"
|
|
|
|
npm2 "github.com/harness/gitness/registry/app/metadata/npm"
|
|
"github.com/harness/gitness/registry/app/pkg/commons"
|
|
"github.com/harness/gitness/registry/app/storage"
|
|
)
|
|
|
|
type GetMetadataResponse struct {
|
|
BaseResponse
|
|
PackageMetadata npm2.PackageMetadata
|
|
}
|
|
|
|
func (r *GetMetadataResponse) GetError() error {
|
|
return r.Error
|
|
}
|
|
|
|
type ListTagResponse struct {
|
|
Tags map[string]string
|
|
BaseResponse
|
|
}
|
|
|
|
func (r *ListTagResponse) GetError() error {
|
|
return r.Error
|
|
}
|
|
|
|
type BaseResponse struct {
|
|
Error error
|
|
ResponseHeaders *commons.ResponseHeaders
|
|
}
|
|
|
|
type GetArtifactResponse struct {
|
|
BaseResponse
|
|
RedirectURL string
|
|
Body *storage.FileReader
|
|
ReadCloser io.ReadCloser
|
|
}
|
|
|
|
func (r *GetArtifactResponse) GetError() error {
|
|
return r.Error
|
|
}
|
|
|
|
type PutArtifactResponse struct {
|
|
Sha256 string
|
|
BaseResponse
|
|
}
|
|
|
|
func (r *PutArtifactResponse) GetError() error {
|
|
return r.Error
|
|
}
|
|
|
|
type HeadMetadataResponse struct {
|
|
BaseResponse
|
|
Exists bool
|
|
}
|
|
|
|
func (r *HeadMetadataResponse) GetError() error {
|
|
return r.Error
|
|
}
|
|
|
|
type DeleteEntityResponse struct {
|
|
Error error
|
|
}
|
|
|
|
func (r *DeleteEntityResponse) GetError() error {
|
|
return r.Error
|
|
}
|
|
|
|
type SearchArtifactResponse struct {
|
|
BaseResponse
|
|
Artifacts *npm2.PackageSearch
|
|
}
|
|
|
|
func (r *SearchArtifactResponse) GetError() error {
|
|
return r.Error
|
|
}
|