resource

package
v0.0.0-...-37b8e2e Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

Builder provides convenience functions for taking arguments and parameters from the command line and converting them to a list of resources to iterate over using the Visitor interface.

func (*Builder) AddError

func (b *Builder) AddError(err error) *Builder

type FilenameOptions

type FilenameOptions struct {
	Filenames []string
	Recursive bool
}

type Info

type Info struct {
	// Client will only be present if this builder was not local
	Client *gitlab.Client
	// Namespace will be set if the object is namespaced and has a specified value.
	Group string
	Name  string

	// Optional, Source is the filename or URL to template file yaml,
	// or stdin to use to handle the resource
	Source string

	Object runtime.Object
	// Optional, this is the most recent resource version the server knows about for
	// this type of resource. It may not match the resource version of the object,
	// but if set it should be equal to or newer than the resource version of the
	// object (however the server defines resource version).
	ResourceVersion string
}

Info contains temporary info to execute a REST call, or show the results of an already completed REST call.

type Visitor

type Visitor interface {
	Visit(VisitorFunc) error
}

Visitor lets clients walk a list of resources.

type VisitorFunc

type VisitorFunc func(*Info, error) error

VisitorFunc implements the Visitor interface for a matching function. If there was a problem walking a list of resources, the incoming error will describe the problem and the function can decide how to handle that error. A nil returned indicates to accept an error to continue loops even when errors happen. This is useful for ignoring certain kinds of errors or aggregating errors in some way.

Jump to

Keyboard shortcuts

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