Documentation
¶
Index ¶
- Variables
- type Manager
- func (m *Manager) Create(context.Context, release.Package) error
- func (m *Manager) Delete(context.Context, string, release.Version) error
- func (m *Manager) DeletePackage(context.Context, string) error
- func (m *Manager) Get(ctx context.Context, pkg string, ver release.Version, ...) (release.Bundle, error)
- func (m *Manager) GetPackage(ctx context.Context, pkg string) (release.Package, error)
- func (m *Manager) List(ctx context.Context, pkg string, filters map[string]string) (iterator.Iterator[release.Bundle], error)
- func (m *Manager) ListPackages(ctx context.Context, filters map[string]string) (iterator.Iterator[release.Package], error)
- func (m *Manager) UpdatePackageMetadata(context.Context, string, map[string]string) error
- func (m *Manager) Upload(context.Context, release.Bundle, release.ProgressReader) error
- type StatusError
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrReadOnly = errors.New("cdnrelease: read-only manager does not support write operations")
ErrReadOnly is returned by write operations.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is a read-only release.Manager that talks to a gcsrelease.Handler over HTTP and downloads data from signed GCS URLs.
func NewManager ¶
NewManager returns a Manager that reads release data from the handler at baseURL. apiClient should carry any necessary auth tokens for the API. Data downloads from signed GCS URLs use a plain http.DefaultClient since signed URLs require no additional auth.
func (*Manager) GetPackage ¶
func (*Manager) ListPackages ¶
func (*Manager) UpdatePackageMetadata ¶
type StatusError ¶
type StatusError struct {
// URL is the request URL that produced the non-2xx response. For
// errors from the signed-URL data download, URL is empty.
URL string
// Status is the HTTP status code returned by the server.
Status int
}
StatusError is returned by Manager methods when an HTTP response reports a non-2xx status. Callers can recover it via errors.As to branch on the HTTP status without string-matching the error message:
var se *cdnrelease.StatusError
if errors.As(err, &se) && se.Status == http.StatusForbidden { ... }
func (*StatusError) Error ¶
func (e *StatusError) Error() string
Click to show internal directories.
Click to hide internal directories.