goscope

package module
v0.0.0-...-c1241cb Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

README

goscope

Go Report Card GitHub go.mod Go version Slack Invite

A library for working with container image contents, layer file trees, and squashed file trees.

Getting Started

See examples/basic.go

docker image save centos:8 -o centos.tar
go run examples/basic.go ./centos.tar

Note: To run tests you will need skopeo installed.

Overview

This library provides the means to:

  • parse and read images from multiple sources, supporting:
    • docker V2 schema images from the docker daemon, podman, or archive
    • OCI images from disk, directory, or registry
    • singularity formatted image files
  • build a file tree representing each layer blob
  • create a squashed file tree representation for each layer
  • search one or more file trees for selected paths
  • catalog file metadata in all layers
  • query the underlying image tar for content (file content within a layer)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cleanup

func Cleanup()

Cleanup deletes all directories created by goscope calls. Deprecated: please use image.Image.Cleanup() over this.

func GetImage

func GetImage(ctx context.Context, userStr string, options ...Option) (*image.Image, error)

GetImage parses the user provided image string and provides an image object; note: the source where the image should be referenced from is automatically inferred.

func GetImageFromSource

func GetImageFromSource(ctx context.Context, imgStr string, source image.Source, options ...Option) (*image.Image, error)

GetImageFromSource returns an image from the explicitly provided source.

func SetBus

func SetBus(b *eventbus.Bus)

func SetLogger

func SetLogger(logger logger.Logger)

Types

type Option

type Option func(*config) error

func WithAdditionalMetadata

func WithAdditionalMetadata(metadata ...image.AdditionalMetadata) Option

func WithCredentials

func WithCredentials(credentials ...image.RegistryCredentials) Option

func WithInsecureAllowHTTP

func WithInsecureAllowHTTP() Option

func WithInsecureSkipTLSVerify

func WithInsecureSkipTLSVerify() Option

func WithPlatform

func WithPlatform(platform string) Option

func WithRegistryOptions

func WithRegistryOptions(options image.RegistryOptions) Option

Jump to

Keyboard shortcuts

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