interlynk

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructInterlynkProjectName added in v0.0.10

func ConstructInterlynkProjectName(ctx tcontext.TransferMetadata, extProjectName, ownerAndGithubRepoName, sbomPath string, SbomData []byte, source string) string

ConstructInterlynkProjectName return project name, in a way that if externally project name is provided, then return it. otherwise depends on source. If sboms fetched from github source, then return project name as <organization>/<repo> for remaining sources like folder, s3, etc. Return their primary component name + it's version, so unique project created for each SBOM file.

func GetProjectNameAndVersion added in v0.0.10

func GetProjectNameAndVersion(ctx tcontext.TransferMetadata, content []byte, assetPath string) string

construct project name from it's primary comp name and it's version by reading sbom content

func ValidateInterlynkConnection

func ValidateInterlynkConnection(url, token string) error

ValidateInterlynkConnection chesks whether Interlynk ssytem is up and running

Types

type Client

type Client struct {
	ApiURL string

	ProjectName    string
	ProjectEnv     string
	ProjectVersion string
	// contains filtered or unexported fields
}

Client handles interactions with the Interlynk API

func NewClient

func NewClient(config Config) *Client

NewClient creates a new Interlynk API client

func (*Client) CreateProjectGroup

func (c *Client) CreateProjectGroup(ctx tcontext.TransferMetadata, name, env string) (string, error)

CreateProjectGroup creates a new project group and returns the default project's ID

func (*Client) FindOrCreateProjectGroup

func (c *Client) FindOrCreateProjectGroup(ctx tcontext.TransferMetadata, finalProjectName string) (string, string, error)

func (*Client) FindProjectGroup

func (c *Client) FindProjectGroup(ctx tcontext.TransferMetadata, name string, env string) (string, error)

func (*Client) UploadSBOM

func (c *Client) UploadSBOM(ctx tcontext.TransferMetadata, envID string, sbomData []byte) error

UploadSBOM uploads a single SBOM from memory to Interlynk

type Config

type Config struct {
	APIURL         string
	Token          string
	ProjectName    string
	ProjectVersion string
	ProjectEnv     string
	Timeout        time.Duration
	MaxAttempts    int
}

Config holds the configuration for the Interlynk client

type InterlynkAdapter

type InterlynkAdapter struct {
	// Config fields
	ProjectName    string
	ProjectVersion string

	ProjectEnv string

	BaseURL string
	ApiKey  string
	Role    types.AdapterRole

	ProcessingMode types.ProcessingMode

	Overwrite bool
	// contains filtered or unexported fields
}

InterlynkAdapter manages SBOM uploads to the Interlynk service.

func (*InterlynkAdapter) AddCommandParams

func (i *InterlynkAdapter) AddCommandParams(cmd *cobra.Command)

AddCommandParams adds GitHub-specific CLI flags

func (*InterlynkAdapter) DryRun

DryRunUpload simulates SBOM upload to Interlynk without actual data transfer.

func (*InterlynkAdapter) FetchSBOMs

FetchSBOMs retrieves SBOMs lazily

func (*InterlynkAdapter) ParseAndValidateParams

func (i *InterlynkAdapter) ParseAndValidateParams(cmd *cobra.Command) error

ParseAndValidateParams validates the Interlynk adapter params

func (*InterlynkAdapter) UploadSBOMs

func (i *InterlynkAdapter) UploadSBOMs(ctx tcontext.TransferMetadata, iterator iterator.SBOMIterator) error

Jump to

Keyboard shortcuts

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