sandbox

package
v0.10.1 Latest Latest
Warning

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

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

Documentation

Overview

sandbox is a package used for testing diegen on patterns that are not otherwise covered within the Kubernetes API

Index

Constants

This section is empty.

Variables

View Source
var DirectBlank = (&DirectDie{}).DieFeed(Direct{})

Functions

This section is empty.

Types

type Direct

type Direct struct {
	Hello string `json:"hello"`
	World string `json:"world"`
}

Direct tests generating a die directly for a struct within the same package +die

func (*Direct) DeepCopy

func (in *Direct) DeepCopy() *Direct

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Direct.

func (*Direct) DeepCopyInto

func (in *Direct) DeepCopyInto(out *Direct)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DirectDie

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

func (*DirectDie) DeepCopy

func (d *DirectDie) DeepCopy() *DirectDie

DeepCopy returns a new die with equivalent state. Useful for snapshotting a mutable die.

func (*DirectDie) DieFeed

func (d *DirectDie) DieFeed(r Direct) *DirectDie

DieFeed returns a new die with the provided resource.

func (*DirectDie) DieFeedJSON added in v0.8.0

func (d *DirectDie) DieFeedJSON(j []byte) *DirectDie

DieFeedJSON returns a new die with the provided JSON. Panics on error.

func (*DirectDie) DieFeedPtr

func (d *DirectDie) DieFeedPtr(r *Direct) *DirectDie

DieFeedPtr returns a new die with the provided resource pointer. If the resource is nil, the empty value is used instead.

func (*DirectDie) DieFeedRawExtension added in v0.5.0

func (d *DirectDie) DieFeedRawExtension(raw runtime.RawExtension) *DirectDie

DieFeedRawExtension returns the resource managed by the die as an raw extension. Panics on error.

func (*DirectDie) DieFeedYAML added in v0.8.0

func (d *DirectDie) DieFeedYAML(y []byte) *DirectDie

DieFeedYAML returns a new die with the provided YAML. Panics on error.

func (*DirectDie) DieFeedYAMLFile added in v0.8.0

func (d *DirectDie) DieFeedYAMLFile(name string) *DirectDie

DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error.

func (*DirectDie) DieImmutable

func (d *DirectDie) DieImmutable(immutable bool) *DirectDie

DieImmutable returns a new die for the current die's state that is either mutable (`false`) or immutable (`true`).

func (*DirectDie) DieRelease

func (d *DirectDie) DieRelease() Direct

DieRelease returns the resource managed by the die.

func (*DirectDie) DieReleaseJSON added in v0.8.0

func (d *DirectDie) DieReleaseJSON() []byte

DieReleaseJSON returns the resource managed by the die as JSON. Panics on error.

func (*DirectDie) DieReleasePtr

func (d *DirectDie) DieReleasePtr() *Direct

DieReleasePtr returns a pointer to the resource managed by the die.

func (*DirectDie) DieReleaseRawExtension added in v0.5.0

func (d *DirectDie) DieReleaseRawExtension() runtime.RawExtension

DieReleaseRawExtension returns the resource managed by the die as an raw extension. Panics on error.

func (*DirectDie) DieReleaseYAML added in v0.8.0

func (d *DirectDie) DieReleaseYAML() []byte

DieReleaseYAML returns the resource managed by the die as YAML. Panics on error.

func (*DirectDie) DieStamp

func (d *DirectDie) DieStamp(fn func(r *Direct)) *DirectDie

DieStamp returns a new die with the resource passed to the callback function. The resource is mutable.

func (*DirectDie) DieStampAt added in v0.8.0

func (d *DirectDie) DieStampAt(jp string, fn interface{}) *DirectDie

Experimental: DieStampAt uses a JSON path (http://goessner.net/articles/JsonPath/) expression to stamp portions of the resource. The callback is invoked with each JSON path match. Panics if the callback function does not accept a single argument of the same type or a pointer to that type as found on the resource at the target location.

Future iterations will improve type coercion from the resource to the callback argument.

func (*DirectDie) DieWith added in v0.9.0

func (d *DirectDie) DieWith(fns ...func(d *DirectDie)) *DirectDie

DieWith returns a new die after passing the current die to the callback function. The passed die is mutable.

func (*DirectDie) Hello

func (d *DirectDie) Hello(v string) *DirectDie

func (*DirectDie) World

func (d *DirectDie) World(v string) *DirectDie

Jump to

Keyboard shortcuts

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