client

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package client is a thin HTTP client for the DevRadar SBOM ingest API.

Index

Constants

View Source
const DefaultBaseURL = "https://devradar.thingz.io"

DefaultBaseURL is the public DevRadar service used when none is configured.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client submits SBOMs to a DevRadar service.

func New

func New(baseURL, token string) *Client

New returns a Client targeting baseURL (trailing slashes trimmed; falls back to DefaultBaseURL when empty) authenticating with the given bearer token.

func (*Client) Submit

func (c *Client) Submit(ctx context.Context, in SubmitRequest) (*SubmitResponse, error)

Submit posts an SBOM to {baseURL}/v1/sboms and returns the decoded response. A non-2xx status is returned as an error including the response body.

type SubmitRequest

type SubmitRequest struct {
	// SBOM is the raw (un-encoded) SBOM document. It is base64-encoded on the wire.
	SBOM []byte
	// ImageRef is the digest-pinned image reference (repo@sha256:…), optional.
	ImageRef string
	// Version is the human tag (e.g. "v1.20.2"), optional.
	Version string
	// Tags are tenant grouping labels (e.g. "team-x", "prod"), optional.
	Tags []string
}

SubmitRequest mirrors the POST /v1/sboms request body. Only SBOM is required; the rest override the service's own parsing of the SBOM when it is weak.

type SubmitResponse

type SubmitResponse struct {
	SBOMID   string `json:"sbom_id"`
	ImageRef string `json:"image_ref"`
	Digest   string `json:"digest"`
	Format   string `json:"format"`
	Existing bool   `json:"existing"`
}

SubmitResponse mirrors the POST /v1/sboms response body.

Jump to

Keyboard shortcuts

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