kubernetesk8s.io/kubernetes/pkg/util/pointer Index | Files

package pointer

import "k8s.io/kubernetes/pkg/util/pointer"

Index

Functions

func AllPtrFieldsNil

func AllPtrFieldsNil(obj interface{}) bool

AllPtrFieldsNil tests whether all pointer fields in a struct are nil. This is useful when, for example, an API struct is handled by plugins which need to distinguish "no plugin accepted this spec" from "this spec is empty".

This function is only valid for structs and pointers to structs. Any other type will cause a panic. Passing a typed nil pointer will return true.

func BoolPtr

func BoolPtr(b bool) *bool

BoolPtr returns a pointer to a bool

func Int32Ptr

func Int32Ptr(i int32) *int32

Int32Ptr returns a pointer to an int32

func Int32PtrDerefOr

func Int32PtrDerefOr(ptr *int32, def int32) int32

Int32PtrDerefOr dereference the int32 ptr and returns it i not nil, else returns def.

Source Files

pointer.go

Version
v1.9.8-beta.0
Published
Apr 18, 2018
Platform
js/wasm
Imports
2 packages
Last checked
4 minutes ago

Tools for package owners.