deepcopy

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package deepcopy generates DeepCopy, DeepCopyInto, and DeepCopyObject implementations for types.

It's ported from k8s.io/code-generator's / k8s.io/gengo's deepcopy-gen, but it's scoped specifically to runtime.Object and skips support for deepcopying interfaces, which aren't handled in CRDs anyway.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	// HeaderFile specifies the header text (e.g. license) to prepend to generated files.
	HeaderFile string `marker:",optional"`
	// Year specifies the year to substitute for " YEAR" in the header file.
	Year string `marker:",optional"`
}

Generator generates code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.

func (Generator) CheckFilter

func (Generator) CheckFilter() loader.NodeFilter

func (Generator) Generate

func (d Generator) Generate(ctx *genall.GenerationContext) error

func (Generator) Help

func (Generator) RegisterMarkers

func (Generator) RegisterMarkers(into *markers.Registry) error

type ObjectGenCtx

type ObjectGenCtx struct {
	Collector  *markers.Collector
	Checker    *loader.TypeChecker
	HeaderText string
}

ObjectGenCtx contains the common info for generating deepcopy implementations. It mostly exists so that generating for a package can be easily tested without requiring a full set of output rules, etc.

Jump to

Keyboard shortcuts

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