Documentation
¶
Overview ¶
Package pub serves hosted Dart and Flutter package repositories to "dart pub" and "flutter pub" through the hosted pub repository spec v2.
A repository is a package server rooted at /repos/pub/{name}: the client's PUB_HOSTED_URL or the "hosted" url of a dependency. The package implements the package document (every version with its pubspec and archive checksum), the version document, the archive download, and "dart pub publish" (a three-step flow: the upload URL, the multipart archive upload, the finishing GET). Retraction, discontinuation, advisories and search are not served.
Index ¶
Constants ¶
const FormatName = "pub"
FormatName is the repository format name.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPHandler ¶
HTTPHandler serves hosted pub repositories.
func NewHTTPHandler ¶
func NewHTTPHandler(log *logger.Logger, db HTTPStore, blobStore storage.BlobStore, baseURL string) *HTTPHandler
NewHTTPHandler creates the handler.
func (*HTTPHandler) RegisterRepoRoutes ¶
func (h *HTTPHandler) RegisterRepoRoutes(r chi.Router)
RegisterRepoRoutes registers the pub API on the /repos/pub/{name} subrouter. A request for a repository of another format is answered 404.
type HTTPStore ¶
type HTTPStore interface {
base.HandlerStore
CreatePubPackage(ctx context.Context, c *models.PubPackage) error
GetPubPackage(ctx context.Context, repoID string, name string, version string) (*models.PubPackage, error)
ListPubVersions(ctx context.Context, repoID string, name string) ([]*models.PubPackage, error)
}
HTTPStore is the part of the database HTTPHandler needs.