cdnrelease

package
v1.85.2 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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

func NewManager(apiClient *http.Client, baseURL string) *Manager

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) Create

func (*Manager) Delete

func (*Manager) DeletePackage

func (m *Manager) DeletePackage(context.Context, string) error

func (*Manager) Get

func (*Manager) GetPackage

func (m *Manager) GetPackage(ctx context.Context, pkg string) (release.Package, error)

func (*Manager) List

func (m *Manager) List(ctx context.Context, pkg string, filters map[string]string) (iterator.Iterator[release.Bundle], error)

func (*Manager) ListPackages

func (m *Manager) ListPackages(ctx context.Context, filters map[string]string) (iterator.Iterator[release.Package], error)

func (*Manager) UpdatePackageMetadata

func (m *Manager) UpdatePackageMetadata(context.Context, string, map[string]string) error

func (*Manager) Upload

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

Jump to

Keyboard shortcuts

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