imageutil

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesLayer

func BytesLayer(data []byte, opts ...DescriptorOpt) image.Layer

BytesLayer creates a new image.Layer from the given data. The descriptor digest will be overwritten with the digest obtained from the bytes. The descriptor size will be overwritten with the length of the data.

func FileLayer

func FileLayer(path string, opts ...DescriptorOpt) (image.Layer, error)

func JSONValueLayer

func JSONValueLayer(v interface{}, opts ...DescriptorOpt) (image.Layer, error)

func ReadLayerContent

func ReadLayerContent(ctx context.Context, layer image.Layer) ([]byte, error)

ReadLayerContent reads the layer contents into a byte slice.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(config image.Layer) *Builder

func NewBytesConfigBuilder

func NewBytesConfigBuilder(data []byte, opts ...DescriptorOpt) *Builder

func NewJSONConfigBuilder

func NewJSONConfigBuilder(v interface{}, opts ...DescriptorOpt) *Builder

func (*Builder) BytesLayer

func (b *Builder) BytesLayer(data []byte, opts ...DescriptorOpt) *Builder

func (*Builder) Complete

func (b *Builder) Complete(opts ...DescriptorOpt) (image.Image, error)

func (*Builder) FileLayer

func (b *Builder) FileLayer(path string, opts ...DescriptorOpt) *Builder

func (*Builder) Layers

func (b *Builder) Layers(layers ...image.Layer) *Builder

type DescriptorOpt

type DescriptorOpt func(desc *ocispec.Descriptor)

func WithAnnotations

func WithAnnotations(annotations map[string]string) DescriptorOpt

func WithMediaType

func WithMediaType(mediaType string) DescriptorOpt

func WithPlatform

func WithPlatform(platform ocispec.Platform) DescriptorOpt

Jump to

Keyboard shortcuts

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