method

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter func(o types.Object, methodName string) bool

A Filter is a function that determines whether a method should be written for the supplied object. It returns true if the method should be filtered.

func DefinedOutside

func DefinedOutside(fs *token.FileSet, filename string) Filter

DefinedOutside returns a MethodFilter that returns true if the supplied object has a method with the supplied name that is not defined in the supplied filename. The object's filename is determined using the supplied FileSet.

type New

type New func(f *jen.File, o types.Object)

New is a function that adds a method on the supplied object in the supplied file.

func NewGetActive

func NewGetActive(receiver, runtime string) New

NewGetActive returns a NewMethod that writes a GetActive method for the supplied Object to the supplied file.

func NewGetCondition

func NewGetCondition(receiver, runtime string) New

NewGetCondition returns a NewMethod that writes a GetCondition method for the supplied Object to the supplied file.

func NewGetDeletionPolicy

func NewGetDeletionPolicy(receiver, runtime string) New

NewGetDeletionPolicy returns a NewMethod that writes a GetDeletionPolicy method for the supplied Object to the supplied file.

func NewGetExternalLeafRefs

func NewGetExternalLeafRefs(receiver, runtime string) New

NewGetExternalLeafRefs returns a NewMethod that writes a GetExternalLeafRefs method for the supplied Object to the supplied file.

func NewGetNetworkNodeReference

func NewGetNetworkNodeReference(receiver, runtime string) New

NewGetNetworkNodeReference returns a NewMethod that writes a GetNetworkNodeReference method for the supplied Object to the supplied file.

func NewGetResourceIndexes

func NewGetResourceIndexes(receiver, runtime string) New

NewGetResourceIndexes returns a NewMethod that writes a GetResourceIndexes method for the supplied Object to the supplied file.

func NewGetRootNetworkNodeReference

func NewGetRootNetworkNodeReference(receiver, runtime string) New

NewGetRootNetworkNodeReference returns a NewMethod that writes a GetNetworkNodeReference method for the supplied Object to the supplied file. file. Note that unlike NewGetNetworkNodeReference the generated method expects the NetworkNodeReference to be at the root of the struct, not under its Spec field.

func NewGetRootResourceReference

func NewGetRootResourceReference(receiver, runtime string) New

NewGetRootResourceReference returns a NewMethod that writes a GetRootResourceReference method for the supplied Object to the supplied file.

func NewGetTarget

func NewGetTarget(receiver, runtime string) New

NewGetTarget returns a NewMethod that writes a GetTarget method for the supplied Object to the supplied file.

func NewGetUsers

func NewGetUsers(receiver string) New

NewGetUsers returns a NewMethod that writes a GetUsers method for the supplied Object to the supplied file.

func NewManagedGetItems

func NewManagedGetItems(receiver, resource string) New

NewManagedGetItems returns a New that writes a GetItems method for the supplied object to the supplied file.

func NewNetworkNodeUsageGetItems

func NewNetworkNodeUsageGetItems(receiver, resource string) New

NewNetworkNodeUsageGetItems returns a New that writes a GetItems method for the supplied object to the supplied file.

func NewSetActive

func NewSetActive(receiver, runtime string) New

NewSetActive returns a NewMethod that writes a SetActive method for the supplied Object to the supplied file.

func NewSetConditions

func NewSetConditions(receiver, runtime string) New

NewSetConditions returns a NewMethod that writes a SetConditions method for the supplied Object to the supplied file.

func NewSetDeletionPolicy

func NewSetDeletionPolicy(receiver, runtime string) New

NewSetDeletionPolicy returns a NewMethod that writes a SetDeletionPolicy method for the supplied Object to the supplied file.

func NewSetExternalLeafRefs

func NewSetExternalLeafRefs(receiver, runtime string) New

NewSetExternalLeafRefs returns a NewMethod that writes a SetExternalLeafRefs method for the supplied Object to the supplied file.

func NewSetNetworkNodeReference

func NewSetNetworkNodeReference(receiver, runtime string) New

NewSetNetworkNodeReference returns a NewMethod that writes a SetNetworkNodeReference method for the supplied Object to the supplied file.

func NewSetResourceIndexes

func NewSetResourceIndexes(receiver, runtime string) New

NewSetResourceIndexes returns a NewMethod that writes a SetResourceIndexes method for the supplied Object to the supplied file.

func NewSetRootNetworkNodeReference

func NewSetRootNetworkNodeReference(receiver, runtime string) New

NewSetRootNetworkNodeReference returns a NewMethod that writes a SetNetworkNodeReference method for the supplied Object to the supplied file. Note that unlike NewSetNetworkNodeReference the generated method expects the NetworkNodeReference to be at the root of the struct, not under its Spec field.

func NewSetRootResourceReference

func NewSetRootResourceReference(receiver, runtime string) New

NewSetRootResourceReference returns a NewMethod that writes a SetRootResourceReference method for the supplied Object to the supplied file.

func NewSetTarget

func NewSetTarget(receiver, runtime string) New

NewSetTarget returns a NewMethod that writes a SetTarget method for the supplied Object to the supplied file.

func NewSetUsers

func NewSetUsers(receiver string) New

NewSetUsers returns a NewMethod that writes a SetUsers method for the supplied Object to the supplied file.

type Set

type Set map[string]New

A Set is a map of method names to the New functions that produce them.

func (Set) Write

func (s Set) Write(f *jen.File, o types.Object, mf Filter)

Write the method Set for the supplied Object to the supplied file. Methods are filtered by the supplied Filter.

Jump to

Keyboard shortcuts

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