...

Package random

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

Overview ▾

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

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.

type Option

Option is an optional parameter to the random functions

type Option func(opts *options)

func WithSource

func WithSource(source rand.Source) Option

WithSource sets the random number generator source