Versions in this module Expand all Collapse all v0 v0.1.0 Nov 11, 2026 Changes in this version + var ErrNoAccessToken = errors.New("tea: no access token") type Option + func WithPreemptiveAPIKey(rootURL, keyID, secret string) Option v0.0.0 Nov 11, 2026 Changes in this version + var ErrChecksumMismatch = errors.New("tea: checksum mismatch") + var ErrForbidden = errors.New("tea: forbidden (HTTP 403)") + var ErrInsecureURL = errors.New("tea: URL refused by policy") + var ErrInvalidArgument = errors.New("tea: invalid argument") + var ErrInvalidOption = errors.New("tea: invalid option") + var ErrInvalidPageToken = errors.New("tea: invalid page token") + var ErrInvalidRequest = errors.New("tea: invalid request") + var ErrNoAcceptableFormat = errors.New("tea: no acceptable format") + var ErrNoUsableChecksum = errors.New("tea: no usable checksum") + var ErrNotImplemented = errors.New("tea: not implemented") + var ErrObjectUnknown = errors.New("tea: object unknown") + var ErrPageLimit = errors.New("tea: page limit reached") + var ErrRedirectLimit = errors.New("tea: too many redirects") + var ErrResponseTooLarge = errors.New("tea: response body exceeds the limit") + var ErrServer = errors.New("tea: server error (HTTP 5xx)") + var ErrSignatureNotFound = errors.New("tea: signature not found") + var ErrTimeout = errors.New("tea: time bound exceeded") + var ErrTooManyComponents = errors.New("tea: too many components") + var ErrTooManyResults = errors.New("tea: too many discovery results") + var ErrUnauthorized = errors.New("tea: unauthorized (HTTP 401)") + var ErrUnsupportedContentEncoding = errors.New("tea: unsupported content encoding") + var SupportedVersions = []string + func VerifyChecksums(r io.Reader, sums []teaapi.Checksum, o DownloadOptions) ([]teaapi.ChecksumType, error) + type API struct + func (a *API) AllComponentReleaseCollectionsOf(ctx context.Context, id uuid.UUID, p CollectionPage) iter.Seq2[teaapi.Collection, error] + func (a *API) AllComponentReleases(ctx context.Context, q ReleaseQuery) iter.Seq2[teaapi.ComponentRelease, error] + func (a *API) AllComponentReleasesOf(ctx context.Context, id uuid.UUID, p ReleasePage) iter.Seq2[teaapi.ComponentRelease, error] + func (a *API) AllComponents(ctx context.Context, q ComponentQuery) iter.Seq2[teaapi.Component, error] + func (a *API) AllProductReleaseCollectionsOf(ctx context.Context, id uuid.UUID, p CollectionPage) iter.Seq2[teaapi.Collection, error] + func (a *API) AllProductReleases(ctx context.Context, q ReleaseQuery) iter.Seq2[teaapi.ProductRelease, error] + func (a *API) AllProductReleasesOf(ctx context.Context, id uuid.UUID, p ReleasePage) iter.Seq2[teaapi.ProductRelease, error] + func (a *API) AllProducts(ctx context.Context, q ProductQuery) iter.Seq2[teaapi.Product, error] + func (a *API) Base() APIBase + func (a *API) DownloadArtifact(ctx context.Context, ref ArtifactRef, f teaapi.ArtifactFormat, w io.Writer, ...) (DownloadResult, error) + func (a *API) DownloadArtifactToFile(ctx context.Context, ref ArtifactRef, f teaapi.ArtifactFormat, path string, ...) (res DownloadResult, err error) + func (a *API) DownloadLatestArtifact(ctx context.Context, id uuid.UUID, mediaType string, w io.Writer, ...) (DownloadResult, error) + func (a *API) DownloadSignature(ctx context.Context, ref ArtifactRef, f teaapi.ArtifactFormat, w io.Writer, ...) (int64, error) + func (a *API) Generated() *teaapi.ClientWithResponses + func (a *API) GetArtifact(ctx context.Context, id uuid.UUID, version int) (*teaapi.Artifact, error) + func (a *API) GetComponent(ctx context.Context, id uuid.UUID) (*teaapi.Component, error) + func (a *API) GetComponentCLE(ctx context.Context, id uuid.UUID) (*teaapi.Cle, error) + func (a *API) GetComponentRelease(ctx context.Context, id uuid.UUID) (*teaapi.ComponentReleaseWithCollection, error) + func (a *API) GetComponentReleaseCLE(ctx context.Context, id uuid.UUID) (*teaapi.Cle, error) + func (a *API) GetComponentReleaseCollection(ctx context.Context, id uuid.UUID, version int) (*teaapi.Collection, error) + func (a *API) GetLatestArtifact(ctx context.Context, id uuid.UUID) (*teaapi.Artifact, error) + func (a *API) GetLatestComponentReleaseCollection(ctx context.Context, id uuid.UUID) (*teaapi.Collection, error) + func (a *API) GetLatestProductReleaseCollection(ctx context.Context, id uuid.UUID) (*teaapi.Collection, error) + func (a *API) GetProduct(ctx context.Context, id uuid.UUID) (*teaapi.Product, error) + func (a *API) GetProductCLE(ctx context.Context, id uuid.UUID) (*teaapi.Cle, error) + func (a *API) GetProductRelease(ctx context.Context, id uuid.UUID) (*teaapi.ProductReleaseWithCollection, error) + func (a *API) GetProductReleaseCLE(ctx context.Context, id uuid.UUID) (*teaapi.Cle, error) + func (a *API) GetProductReleaseCollection(ctx context.Context, id uuid.UUID, version int) (*teaapi.Collection, error) + func (a *API) ListComponentReleaseCollections(ctx context.Context, id uuid.UUID, pg CollectionPage) (*teaapi.PaginatedCollectionResponse, error) + func (a *API) ListComponentReleases(ctx context.Context, id uuid.UUID, pg ReleasePage) (*teaapi.PaginatedComponentReleaseResponse, error) + func (a *API) ListProductReleaseCollections(ctx context.Context, id uuid.UUID, pg CollectionPage) (*teaapi.PaginatedCollectionResponse, error) + func (a *API) ListProductReleases(ctx context.Context, id uuid.UUID, pg ReleasePage) (*teaapi.PaginatedProductReleaseResponse, error) + func (a *API) QueryComponentReleases(ctx context.Context, q ReleaseQuery) (*teaapi.PaginatedComponentReleaseResponse, error) + func (a *API) QueryComponents(ctx context.Context, q ComponentQuery) (*teaapi.PaginatedComponentResponse, error) + func (a *API) QueryProductReleases(ctx context.Context, q ReleaseQuery) (*teaapi.PaginatedProductReleaseResponse, error) + func (a *API) QueryProducts(ctx context.Context, q ProductQuery) (*teaapi.PaginatedProductResponse, error) + func (a *API) RequestToken(ctx context.Context, keyID, secret string) (*teaapi.TokenResponse, error) + type APIBase struct + func ParseAPIBase(rootURL, version string) (APIBase, error) + func (b APIBase) RootURL() string + func (b APIBase) String() string + func (b APIBase) Version() string + type APIError struct + Challenge *Challenge + Code ErrorCode + Message string + Operation string + RawCode string + Status int + TEA bool + func (e *APIError) Error() string + func (e *APIError) Is(target error) bool + type AmbiguousError struct + Results []DiscoveryResult + func (e *AmbiguousError) Error() string + type ArtifactRef struct + UUID uuid.UUID + Version int + type Attempt struct + Err error + Reason string + Stage Stage + URL string + type Candidate struct + API *API + Release *teaapi.ProductReleaseWithCollection + Result DiscoveryResult + type Challenge struct + Error string + Scheme string + type ChecksumError struct + Actual string + Alg teaapi.ChecksumType + Expected string + func (e *ChecksumError) Error() string + func (e *ChecksumError) Unwrap() error + type Client struct + func New(opts ...Option) (*Client, error) + func (c *Client) API(base APIBase) (*API, error) + func (c *Client) Candidates(ctx context.Context, results []DiscoveryResult) ([]Candidate, error) + func (c *Client) Discover(ctx context.Context, t tei.TEI) ([]DiscoveryResult, error) + func (c *Client) DiscoverPURL(ctx context.Context, base APIBase, purl string) ([]DiscoveryResult, error) + func (c *Client) FlowFromRelease(ctx context.Context, a *API, release uuid.UUID, o FlowOptions) (*FlowResult, error) + func (c *Client) FullFlow(ctx context.Context, t tei.TEI, o FlowOptions) (*FlowResult, error) + func (c *Client) SelectServer(r DiscoveryResult) (APIBase, error) + type CollectionPage struct + SortField CollectionSortField + type CollectionSortField string + const CollectionSortVersion + func (f CollectionSortField) Valid() bool + type ComponentQuery struct + IDType teaapi.IdentifierType + IDValue string + SortField ComponentSortField + type ComponentSortField string + const ComponentSortName + func (f ComponentSortField) Valid() bool + type DiscoveryError struct + Attempts []Attempt + Stage Stage + func (e *DiscoveryError) Error() string + func (e *DiscoveryError) Unwrap() []error + type DiscoveryResult struct + DiscoveredAt APIBase + ProductReleaseUUID uuid.UUID + Servers []teaapi.ServerInfo + type DownloadOptions struct + AllowSHA1Only bool + MaxBytes int64 + type DownloadResult struct + Bytes int64 + MediaType string + Source DownloadSource + Verified []teaapi.ChecksumType + type DownloadSource string + const DownloadSourceExternal + const DownloadSourceServer + type ErrorCode string + const ErrorCodeInvalidPageToken + const ErrorCodeInvalidRequest + const ErrorCodeNoAcceptableFormat + const ErrorCodeNotImplemented + const ErrorCodeObjectUnknown + const ErrorCodeSignatureNotFound + const ErrorCodeUnknown + type FlowComponent struct + CLE *teaapi.Cle + Component *teaapi.Component + Err error + Pinned bool + Ref teaapi.ComponentRef + Release *teaapi.ComponentReleaseWithCollection + type FlowOptions struct + Select func(ctx context.Context, cands []Candidate) (int, error) + SkipCLE bool + type FlowResult struct + API *API + Components []FlowComponent + Release *teaapi.ProductReleaseWithCollection + ReleaseCLE *teaapi.Cle + type Limits struct + AttemptTimeout time.Duration + CallTimeout time.Duration + DiscoveryBytes int64 + DiscoveryResults int + DownloadBytes int64 + ErrorBodyBytes int64 + FlowComponents int + IdleTimeout time.Duration + JSONBytes int64 + Pages int + Redirects int + SignatureBytes int64 + WellKnownBytes int64 + type NotResolvedError struct + Base APIBase + Code ErrorCode + RawCode string + func (e *NotResolvedError) Error() string + func (e *NotResolvedError) Is(target error) bool + type Option func(*options) + func WithAPIKey(rootURL, keyID, secret string) Option + func WithBearerToken(rootURL, token string) Option + func WithDiscoveryAttempts(n int, firstBackoff time.Duration) Option + func WithHTTPClient(hc *http.Client) Option + func WithInsecureHTTPBase(rawURL string) Option + func WithLimits(l Limits) Option + func WithTrace(f func(TraceEvent)) Option + func WithUserAgent(ua string) Option + func WithWellKnownLocation(domain, location string) Option + type Page struct + PageSize int + PageToken string + SortOrder SortOrder + type ProductQuery struct + IDType teaapi.IdentifierType + IDValue string + SortField ProductSortField + type ProductSortField string + const ProductSortName + func (f ProductSortField) Valid() bool + type ReleasePage struct + SortField ReleaseSortField + type ReleaseQuery struct + IDType teaapi.IdentifierType + IDValue string + SortField ReleaseSortField + type ReleaseSortField string + const ReleaseSortCreatedDate + const ReleaseSortReleaseDate + const ReleaseSortVersion + func (f ReleaseSortField) Valid() bool + type SortOrder string + const SortAsc + const SortDesc + func (o SortOrder) Valid() bool + type Stage string + const StageAPI + const StageAPIDiscovery + const StageDownload + const StageToken + const StageWellKnown + type TokenError struct + Code teaapi.TokenErrorResponseError + Description string + Status int + func (e *TokenError) Error() string + type TraceEvent struct + Kind TraceKind + Method string + Reason string + Stage Stage + Status int + URL string + Wait time.Duration + type TraceKind string + const TraceAttemptFailed + const TraceBackoff + const TraceRequest + const TraceResponse + type URLPolicyError struct + Reason string + URL string + func (e *URLPolicyError) Error() string + func (e *URLPolicyError) Unwrap() error + type UnexpectedResponseError struct + Operation string + Reason string + Status int + func (e *UnexpectedResponseError) Error() string