bundle

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MPL-2.0 Imports: 6 Imported by: 1

Documentation

Overview

Package bundle describes support cmd input options.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Archive

type Archive interface {
	Write(path string, contents []byte) error
	Close() error
}

Archive defines archive writer interface.

type Option

type Option func(*Options)

Option defines a single bundle option.

func WithArchive

func WithArchive(archive Archive) Option

WithArchive runs bundle creator with archive object.

func WithArchiveOutput

func WithArchiveOutput(writer io.Writer) Option

WithArchiveOutput runs bundle creator with archive output.

func WithKubernetesClient

func WithKubernetesClient(clientset *kubernetes.Clientset) Option

WithKubernetesClient runs bundle creator with the Kubernetes client.

func WithLogOutput

func WithLogOutput(writer io.Writer) Option

WithLogOutput runs bundle creator with logs output.

func WithNodes

func WithNodes(nodes ...string) Option

WithNodes passes the list of nodes to get the data from.

func WithNumWorkers

func WithNumWorkers(count int) Option

WithNumWorkers runs bundle creator with number of workers.

func WithProgressChan

func WithProgressChan(progress chan Progress) Option

WithProgressChan runs bundle creator with the progress reporter to the channel.

func WithTalosClient

func WithTalosClient(client *client.Client) Option

WithTalosClient runs bundle creator with the Talos client.

type Options

type Options struct {
	TalosClient      *client.Client
	KubernetesClient *kubernetes.Clientset
	Archive          Archive
	LogOutput        io.Writer
	Progress         chan Progress
	Nodes            []string

	NumWorkers int
}

Options defines GetSupportBundle options.

func NewOptions

func NewOptions(opts ...Option) *Options

NewOptions creates new Options.

func (*Options) Log

func (options *Options) Log(line string, args ...interface{})

Log writes the line to logger or to stdout if no logger was provided.

type Progress

type Progress struct {
	Error  error
	Source string
	State  string
	Total  int
}

Progress reports current bundle collection progress.

Jump to

Keyboard shortcuts

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