test

package
v0.1.267 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package test provides mock implementations of the APK v1 gRPC clients for use in unit tests.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APKSummariesOnList added in v0.1.51

type APKSummariesOnList struct {
	Given *apk.APKSummaryFilter
	List  *apk.APKPackageSummaryList
	Error error
}

type APKsOnList

type APKsOnList struct {
	Given *apk.APKFilter
	List  *apk.APKList
	Error error
}

type MockAPKClient

type MockAPKClient struct {
	apk.APKClient

	OnListAPKs         []APKsOnList
	OnListAPKSummaries []APKSummariesOnList
}

func (MockAPKClient) ListAPKSummaries added in v0.1.51

func (MockAPKClient) ListAPKs

func (m MockAPKClient) ListAPKs(_ context.Context, given *apk.APKFilter, _ ...grpc.CallOption) (*apk.APKList, error)

type MockAPKClients

type MockAPKClients struct {
	OnClose error

	APKClient MockAPKClient
}
Example

ExampleMockAPKClients demonstrates constructing a mock APK client.

package main

import (
	"fmt"

	apktest "chainguard.dev/sdk/proto/platform/apk/v1/test"
)

func main() {
	mock := apktest.MockAPKClients{}
	fmt.Println(mock.Close())
}
Output:
<nil>

func (MockAPKClients) APK

func (m MockAPKClients) APK() apk.APKClient

func (MockAPKClients) Close

func (m MockAPKClients) Close() error

Jump to

Keyboard shortcuts

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