platform

package
v0.1.116 Latest Latest
Warning

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

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

Documentation

Overview

Package platform provides gRPC client factories for all Chainguard platform services, including IAM, registry, advisory, and OIDC APIs.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUserAgent

func GetUserAgent(ctx context.Context) string

GetUserAgent extracts the user agent string from the context

Example

ExampleGetUserAgent demonstrates retrieving a user agent from an empty context.

package main

import (
	"context"
	"fmt"

	"chainguard.dev/sdk/proto/platform"
)

func main() {
	ctx := context.Background()
	fmt.Println(platform.GetUserAgent(ctx) == "")
}
Output:
true

func WithUserAgent

func WithUserAgent(ctx context.Context, userAgent string) context.Context

WithUserAgent adds a UserAgent string to the context passed to the GRPC client

Example

ExampleWithUserAgent demonstrates storing a user agent string in context.

package main

import (
	"context"
	"fmt"

	"chainguard.dev/sdk/proto/platform"
)

func main() {
	ctx := context.Background()
	ctx = platform.WithUserAgent(ctx, "my-client/1.0")
	fmt.Println(platform.GetUserAgent(ctx))
}
Output:
my-client/1.0

Types

type Clients

type Clients interface {
	IAM() iam.Clients
	Registry() registry.Clients
	Advisory() advisory.Clients
	Ping() ping.Clients
	APK() apk.Clients
	Ecosystems() ecosystems.Clients
	Libraries() libraries.Clients
	Skills() skills.Clients
	Packages() packages.Clients
	Vulnerabilities() vulnerabilities.Clients
	ImageMatcher() matcher.Clients
	Policies() policies.Clients
	Argos() argos.Clients

	// Connection returns the underlying gRPC connection for creating additional clients.
	// This is useful for internal consumers that need access to experimental APIs.
	Connection() *grpc.ClientConn

	Close() error
}

func NewPlatformClients

func NewPlatformClients(ctx context.Context, apiURL string, cred credentials.PerRPCCredentials, addlOpts ...grpc.DialOption) (Clients, error)

type OIDCClients

type OIDCClients interface {
	Auth() platformauth.AuthClient
	OIDC() platformoidc.Clients
	OIDCPing() ping.Clients

	Close() error
}

func NewOIDCClients

func NewOIDCClients(ctx context.Context, issuerURL string, cred credentials.PerRPCCredentials) (OIDCClients, error)

Directories

Path Synopsis
actions
v1
Package v1 contains the v1 GRPC client and server definitions for authorizing GitHub Actions runners.
Package v1 contains the v1 GRPC client and server definitions for authorizing GitHub Actions runners.
advisory
v1
Package v1 contains the v1 GRPC client and server definitions for implementing Advisory interactions.
Package v1 contains the v1 GRPC client and server definitions for implementing Advisory interactions.
v1/test
Package test provides mock implementations of the advisory v1 gRPC clients for use in unit tests.
Package test provides mock implementations of the advisory v1 gRPC clients for use in unit tests.
apk
v1
Package v1 contains the v1 GRPC client and server definitions for implementing APK interactions.
Package v1 contains the v1 GRPC client and server definitions for implementing APK interactions.
v1/test
Package test provides mock implementations of the APK v1 gRPC clients for use in unit tests.
Package test provides mock implementations of the APK v1 gRPC clients for use in unit tests.
argos
v1
v1/test
Package test provides mock implementations of the v1 Argos clients.
Package test provides mock implementations of the v1 Argos clients.
auth
v1
Package v1 contains the v1 GRPC client and server definitions for implementing Auth interactions for the Console.
Package v1 contains the v1 GRPC client and server definitions for implementing Auth interactions for the Console.
v1/test
Package test provides mock implementations of the auth service for testing.
Package test provides mock implementations of the auth service for testing.
common
v1
Package common contains Chainguard shared types exposed to the console.
Package common contains Chainguard shared types exposed to the console.
ecosystems
v1
Package v1 contains the v1 GRPC client and server definitions for implementing Ecosystem interactions for the Console.
Package v1 contains the v1 GRPC client and server definitions for implementing Ecosystem interactions for the Console.
v1/test
Package test provides mock implementations of the ecosystems v1 gRPC clients for use in unit tests.
Package test provides mock implementations of the ecosystems v1 gRPC clients for use in unit tests.
events
v1
Package events contains the GRPC client and server definitions for implementing eventing interactions for the Console.
Package events contains the GRPC client and server definitions for implementing eventing interactions for the Console.
iam
v1
Package v1 provides gRPC client and server definitions for IAM interactions with the Chainguard Console.
Package v1 provides gRPC client and server definitions for IAM interactions with the Chainguard Console.
v1/test
Package test provides mock implementations of IAM gRPC clients for testing.
Package test provides mock implementations of IAM gRPC clients for testing.
libraries
v1
Package v1 contains the v1 GRPC client and server definitions for implementing Libraries interactions for the Console.
Package v1 contains the v1 GRPC client and server definitions for implementing Libraries interactions for the Console.
v1/test
Package test provides mock implementations of the Libraries API clients for testing purposes.
Package test provides mock implementations of the Libraries API clients for testing purposes.
matcher
v1
Package v1 contains the v1 GRPC client and server definitions for implementing Crystal Ball interactions.
Package v1 contains the v1 GRPC client and server definitions for implementing Crystal Ball interactions.
v1/test
Package test provides mock implementations of the image matcher v1 gRPC clients for use in unit tests.
Package test provides mock implementations of the image matcher v1 gRPC clients for use in unit tests.
oidc
v1
Package v1 contains the v1 GRPC client and server definitions for implementing OIDC interactions for the Platform.
Package v1 contains the v1 GRPC client and server definitions for implementing OIDC interactions for the Platform.
v1/test
Package test provides mock implementations of the OIDC v1 gRPC clients for use in unit tests.
Package test provides mock implementations of the OIDC v1 gRPC clients for use in unit tests.
packages
v1
Package v1 contains the v1 GRPC client and server definitions for implementing Packages interactions for the Console.
Package v1 contains the v1 GRPC client and server definitions for implementing Packages interactions for the Console.
v1/test
Package test provides mock implementations of the Packages API clients for testing purposes.
Package test provides mock implementations of the Packages API clients for testing purposes.
ping
v1
Package v1 contains the v1 GRPC client and server definitions for implementing ping interactions for the Platform.
Package v1 contains the v1 GRPC client and server definitions for implementing ping interactions for the Platform.
v1/test
Package test provides mock implementations of the ping v1 gRPC clients for use in unit tests.
Package test provides mock implementations of the ping v1 gRPC clients for use in unit tests.
policies
v1
Package v1 contains the v1 GRPC client and server definitions for implementing Policies interactions.
Package v1 contains the v1 GRPC client and server definitions for implementing Policies interactions.
v1/test
Package test provides mock implementations of Policies gRPC clients for testing.
Package test provides mock implementations of Policies gRPC clients for testing.
registry
v1
Package v1 contains the v1 GRPC client and server definitions for implementing Registry interactions.
Package v1 contains the v1 GRPC client and server definitions for implementing Registry interactions.
v1/test
Package test provides mock implementations of Registry gRPC clients for testing.
Package test provides mock implementations of Registry gRPC clients for testing.
skills
v1
Package v1 contains the v1 gRPC client and server definitions for implementing Skills Entitlements interactions.
Package v1 contains the v1 gRPC client and server definitions for implementing Skills Entitlements interactions.
tenant
v1
Package v1 contains the v1 GRPC client and server definitions for implementing Tenant interactions for the Console.
Package v1 contains the v1 GRPC client and server definitions for implementing Tenant interactions for the Console.
Package test provides mock implementations of the Chainguard platform gRPC clients for use in unit tests.
Package test provides mock implementations of the Chainguard platform gRPC clients for use in unit tests.
vulnerabilities
v1
Package v1 contains the platform API for the advisory service.
Package v1 contains the platform API for the advisory service.
v1/test
Package test provides mock implementations of the vulnerabilities v1 gRPC clients for use in unit tests.
Package test provides mock implementations of the vulnerabilities v1 gRPC clients for use in unit tests.

Jump to

Keyboard shortcuts

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