provider

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Archive

type Archive struct {
	URL    string   `json:"url"`
	Hashes []string `json:"hashes"`
}

type DownloadArchiveRequest

type DownloadArchiveRequest struct {
	Hostname  string `path:"hostname"`
	Namespace string `path:"namespace"`
	Type      string `path:"type"`
	Archive   string `path:"archive"`

	Version string
	OS      string
	Arch    string

	Context *gin.Context
	// contains filtered or unexported fields
}

func (*DownloadArchiveRequest) SetGinContext

func (r *DownloadArchiveRequest) SetGinContext(ctx *gin.Context)

func (*DownloadArchiveRequest) Validate

func (r *DownloadArchiveRequest) Validate() error

type GetMetadataRequest

type GetMetadataRequest struct {
	Hostname  string `path:"hostname"`
	Namespace string `path:"namespace"`
	Type      string `path:"type"`
	Action    string `path:"action"` // Eg. Index.json for list versions, {version}.json for list versioned package.

	Context *gin.Context
	// contains filtered or unexported fields
}

func (*GetMetadataRequest) SetGinContext

func (r *GetMetadataRequest) SetGinContext(ctx *gin.Context)

func (*GetMetadataRequest) Validate

func (r *GetMetadataRequest) Validate() error

func (*GetMetadataRequest) Version

func (r *GetMetadataRequest) Version() string

type GetMetadataResponse

type GetMetadataResponse struct {
	Versions sets.Set[string]   `json:"versions,omitempty"`
	Archives map[string]Archive `json:"archives,omitempty"`
}

type Handler

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

func Handle

func Handle(service *provider.Service) *Handler

func (*Handler) DownloadArchive

func (h *Handler) DownloadArchive(req DownloadArchiveRequest) (render.Render, error)

func (*Handler) GetMetadata

func (h *Handler) GetMetadata(req GetMetadataRequest) (GetMetadataResponse, error)

func (*Handler) SyncMetadata

func (h *Handler) SyncMetadata(req SyncMetadataRequest) error

type SyncMetadataRequest

type SyncMetadataRequest struct {
	Timeout time.Duration `query:"timeout,default=2m"`

	Context *gin.Context
	// contains filtered or unexported fields
}

func (*SyncMetadataRequest) SetGinContext

func (r *SyncMetadataRequest) SetGinContext(ctx *gin.Context)

Jump to

Keyboard shortcuts

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