package random

import "github.com/google/go-containerregistry/pkg/v1/random"

Package random provides a facility for synthesizing pseudo-random images.

Index

Functions

func Image

func Image(byteSize, layers int64, options ...Option) (v1.Image, error)

Image returns a pseudo-randomly generated Image.

func Index

func Index(byteSize, layers, count int64, options ...Option) (v1.ImageIndex, error)

Index returns a pseudo-randomly generated ImageIndex with count images, each having the given number of layers of size byteSize.

func Layer

func Layer(byteSize int64, mt types.MediaType, options ...Option) (v1.Layer, error)

Layer returns a layer with pseudo-randomly generated content.

Types

type Option

type Option func(opts *options)

Option is an optional parameter to the random functions

func WithSource

func WithSource(source rand.Source) Option

WithSource sets the random number generator source

Source Files

doc.go image.go index.go options.go

Version
v0.20.3 (latest)
Published
Jan 15, 2025
Platform
linux/amd64
Imports
13 packages
Last checked
16 hours ago

Tools for package owners.