pointer

package
v0.0.0-...-3ea5e8c Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 2 Imported by: 2,735

README

Pointer

This package provides some functions for pointer-based operations.

Documentation

Overview

Deprecated: Use functions in k8s.io/utils/ptr instead: ptr.To to obtain a pointer, ptr.Deref to dereference a pointer, ptr.Equal to compare dereferenced pointers.

Index

Constants

This section is empty.

Variables

View Source
var AllPtrFieldsNil = ptr.AllPtrFieldsNil

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.

Deprecated: Use ptr.AllPtrFieldsNil instead.

View Source
var Bool = ptr.To[bool]

Bool returns a pointer to a bool.

View Source
var BoolDeref = ptr.Deref[bool]

BoolDeref dereferences the bool ptr and returns it if not nil, or else returns def.

View Source
var BoolEqual = ptr.Equal[bool]

BoolEqual returns true if both arguments are nil or both arguments dereference to the same value.

View Source
var BoolPtr = Bool // for back-compat

BoolPtr is a function variable referring to Bool.

Deprecated: Use ptr.To instead.

View Source
var BoolPtrDerefOr = BoolDeref // for back-compat

BoolPtrDerefOr is a function variable referring to BoolDeref.

Deprecated: Use ptr.Deref instead.

View Source
var Duration = ptr.To[time.Duration]

Duration returns a pointer to a time.Duration.

View Source
var DurationDeref = ptr.Deref[time.Duration]

DurationDeref dereferences the time.Duration ptr and returns it if not nil, or else returns def.

View Source
var DurationEqual = ptr.Equal[time.Duration]

DurationEqual returns true if both arguments are nil or both arguments dereference to the same value.

View Source
var Float32 = ptr.To[float32]

Float32 returns a pointer to a float32.

View Source
var Float32Deref = ptr.Deref[float32]

Float32Deref dereferences the float32 ptr and returns it if not nil, or else returns def.

View Source
var Float32Equal = ptr.Equal[float32]

Float32Equal returns true if both arguments are nil or both arguments dereference to the same value.

View Source
var Float32Ptr = Float32

Float32Ptr is a function variable referring to Float32.

Deprecated: Use ptr.To instead.

View Source
var Float32PtrDerefOr = Float32Deref // for back-compat

Float32PtrDerefOr is a function variable referring to Float32Deref.

Deprecated: Use ptr.Deref instead.

View Source
var Float64 = ptr.To[float64]

Float64 returns a pointer to a float64.

View Source
var Float64Deref = ptr.Deref[float64]

Float64Deref dereferences the float64 ptr and returns it if not nil, or else returns def.

View Source
var Float64Equal = ptr.Equal[float64]

Float64Equal returns true if both arguments are nil or both arguments dereference to the same value.

View Source
var Float64Ptr = Float64

Float64Ptr is a function variable referring to Float64.

Deprecated: Use ptr.To instead.

View Source
var Float64PtrDerefOr = Float64Deref // for back-compat

Float64PtrDerefOr is a function variable referring to Float64Deref.

Deprecated: Use ptr.Deref instead.

View Source
var Int = ptr.To[int]

Int returns a pointer to an int.

View Source
var Int32 = ptr.To[int32]

Int32 returns a pointer to an int32.

View Source
var Int32Deref = ptr.Deref[int32]

Int32Deref dereferences the int32 ptr and returns it if not nil, or else returns def.

View Source
var Int32Equal = ptr.Equal[int32]

Int32Equal returns true if both arguments are nil or both arguments dereference to the same value.

View Source
var Int32Ptr = Int32 // for back-compat

Int32Ptr is a function variable referring to Int32.

Deprecated: Use ptr.To instead.

View Source
var Int32PtrDerefOr = Int32Deref // for back-compat

Int32PtrDerefOr is a function variable referring to Int32Deref.

Deprecated: Use ptr.Deref instead.

View Source
var Int64 = ptr.To[int64]

Int64 returns a pointer to an int64.

View Source
var Int64Deref = ptr.Deref[int64]

Int64Deref dereferences the int64 ptr and returns it if not nil, or else returns def.

View Source
var Int64Equal = ptr.Equal[int64]

Int64Equal returns true if both arguments are nil or both arguments dereference to the same value.

View Source
var Int64Ptr = Int64 // for back-compat

Int64Ptr is a function variable referring to Int64.

Deprecated: Use ptr.To instead.

View Source
var Int64PtrDerefOr = Int64Deref // for back-compat

Int64PtrDerefOr is a function variable referring to Int64Deref.

Deprecated: Use ptr.Deref instead.

View Source
var IntDeref = ptr.Deref[int]

IntDeref dereferences the int ptr and returns it if not nil, or else returns def.

View Source
var IntPtr = Int // for back-compat

IntPtr is a function variable referring to Int.

Deprecated: Use ptr.To instead.

View Source
var IntPtrDerefOr = IntDeref // for back-compat

IntPtrDerefOr is a function variable referring to IntDeref.

Deprecated: Use ptr.Deref instead.

View Source
var String = ptr.To[string]

String returns a pointer to a string.

View Source
var StringDeref = ptr.Deref[string]

StringDeref dereferences the string ptr and returns it if not nil, or else returns def.

View Source
var StringEqual = ptr.Equal[string]

StringEqual returns true if both arguments are nil or both arguments dereference to the same value.

View Source
var StringPtr = String // for back-compat

StringPtr is a function variable referring to String.

Deprecated: Use ptr.To instead.

View Source
var StringPtrDerefOr = StringDeref // for back-compat

StringPtrDerefOr is a function variable referring to StringDeref.

Deprecated: Use ptr.Deref instead.

View Source
var Uint = ptr.To[uint]

Uint returns a pointer to an uint

View Source
var Uint32 = ptr.To[uint32]

Uint32 returns a pointer to an uint32.

View Source
var Uint32Deref = ptr.Deref[uint32]

Uint32Deref dereferences the uint32 ptr and returns it if not nil, or else returns def.

View Source
var Uint32Equal = ptr.Equal[uint32]

Uint32Equal returns true if both arguments are nil or both arguments dereference to the same value.

View Source
var Uint32Ptr = Uint32 // for back-compat

Uint32Ptr is a function variable referring to Uint32.

Deprecated: Use ptr.To instead.

View Source
var Uint32PtrDerefOr = Uint32Deref // for back-compat

Uint32PtrDerefOr is a function variable referring to Uint32Deref.

Deprecated: Use ptr.Deref instead.

View Source
var Uint64 = ptr.To[uint64]

Uint64 returns a pointer to an uint64.

View Source
var Uint64Deref = ptr.Deref[uint64]

Uint64Deref dereferences the uint64 ptr and returns it if not nil, or else returns def.

View Source
var Uint64Equal = ptr.Equal[uint64]

Uint64Equal returns true if both arguments are nil or both arguments dereference to the same value.

View Source
var Uint64Ptr = Uint64 // for back-compat

Uint64Ptr is a function variable referring to Uint64.

Deprecated: Use ptr.To instead.

View Source
var Uint64PtrDerefOr = Uint64Deref // for back-compat

Uint64PtrDerefOr is a function variable referring to Uint64Deref.

Deprecated: Use ptr.Deref instead.

View Source
var UintDeref = ptr.Deref[uint]

UintDeref dereferences the uint ptr and returns it if not nil, or else returns def.

View Source
var UintPtr = Uint // for back-compat

UintPtr is a function variable referring to Uint.

Deprecated: Use ptr.To instead.

View Source
var UintPtrDerefOr = UintDeref // for back-compat

UintPtrDerefOr is a function variable referring to UintDeref.

Deprecated: Use ptr.Deref instead.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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