Documentation ¶
Overview ¶
Package tests serves a list of tests for tailscale.com/cmd/viewer.
Index ¶
- type BasicType
- type Container
- type ContainerView
- type GenericBasicStruct
- type GenericCloneableStruct
- type GenericCloneableStructView
- func (v GenericCloneableStructView[T, V]) AsStruct() *GenericCloneableStruct[T, V]
- func (v GenericCloneableStructView[T, V]) Map() views.MapFn[string, T, V]
- func (v GenericCloneableStructView[T, V]) MarshalJSON() ([]byte, error)
- func (v GenericCloneableStructView[T, V]) Pointer() map[string]T
- func (v GenericCloneableStructView[T, V]) PtrKeyMap() map[*T]string
- func (v GenericCloneableStructView[T, V]) PtrSlice() *T
- func (v GenericCloneableStructView[T, V]) PtrValueMap() map[string]*T
- func (v GenericCloneableStructView[T, V]) Slice() views.SliceView[T, V]
- func (v GenericCloneableStructView[T, V]) SliceMap() map[string][]T
- func (v *GenericCloneableStructView[T, V]) UnmarshalJSON(b []byte) error
- func (v GenericCloneableStructView[T, V]) Valid() bool
- func (v GenericCloneableStructView[T, V]) Value() V
- type GenericIntStruct
- type GenericIntStructView
- func (v GenericIntStructView[T]) AsStruct() *GenericIntStruct[T]
- func (v GenericIntStructView[T]) Map() views.Map[string, T]
- func (v GenericIntStructView[T]) MarshalJSON() ([]byte, error)
- func (v GenericIntStructView[T]) Pointer() *T
- func (v GenericIntStructView[T]) PtrKeyMap() map[*T]string
- func (v GenericIntStructView[T]) PtrSlice() *T
- func (v GenericIntStructView[T]) PtrValueMap() map[string]*T
- func (v GenericIntStructView[T]) Slice() views.Slice[T]
- func (v GenericIntStructView[T]) SliceMap() map[string][]T
- func (v *GenericIntStructView[T]) UnmarshalJSON(b []byte) error
- func (v GenericIntStructView[T]) Valid() bool
- func (v GenericIntStructView[T]) Value() T
- type GenericNoPtrsStruct
- type GenericNoPtrsStructView
- func (v GenericNoPtrsStructView[T]) AsStruct() *GenericNoPtrsStruct[T]
- func (v GenericNoPtrsStructView[T]) Map() views.Map[string, T]
- func (v GenericNoPtrsStructView[T]) MarshalJSON() ([]byte, error)
- func (v GenericNoPtrsStructView[T]) Pointer() *T
- func (v GenericNoPtrsStructView[T]) PtrKeyMap() map[*T]string
- func (v GenericNoPtrsStructView[T]) PtrSlice() *T
- func (v GenericNoPtrsStructView[T]) PtrValueMap() map[string]*T
- func (v GenericNoPtrsStructView[T]) Slice() views.Slice[T]
- func (v GenericNoPtrsStructView[T]) SliceMap() map[string][]T
- func (v *GenericNoPtrsStructView[T]) UnmarshalJSON(b []byte) error
- func (v GenericNoPtrsStructView[T]) Valid() bool
- func (v GenericNoPtrsStructView[T]) Value() T
- type GenericTypeAliasStruct
- type GenericTypeAliasStructView
- func (v GenericTypeAliasStructView[T, T2, V2]) AsStruct() *GenericTypeAliasStruct[T, T2, V2]
- func (v GenericTypeAliasStructView[T, T2, V2]) Cloneable() V2
- func (v GenericTypeAliasStructView[T, T2, V2]) MarshalJSON() ([]byte, error)
- func (v GenericTypeAliasStructView[T, T2, V2]) NonCloneable() T
- func (v *GenericTypeAliasStructView[T, T2, V2]) UnmarshalJSON(b []byte) error
- func (v GenericTypeAliasStructView[T, T2, V2]) Valid() bool
- type Map
- type MapContainer
- type MapContainerView
- type MapView
- func (v MapView) AsStruct() *Map
- func (v MapView) Int() views.Map[string, int]
- func (v MapView) MarshalJSON() ([]byte, error)
- func (v MapView) PointerKey() map[*string]int
- func (v MapView) SliceInt() views.MapSlice[string, int]
- func (v MapView) SliceIntPtr() map[string][]*int
- func (v MapView) SlicesWithPtrs() ...
- func (v MapView) SlicesWithoutPtrs() ...
- func (v MapView) StructPtrWithPtr() views.MapFn[string, *StructWithPtrs, StructWithPtrsView]
- func (v MapView) StructPtrWithoutPtr() views.MapFn[string, *StructWithoutPtrs, StructWithoutPtrsView]
- func (v MapView) StructWithPtr() views.MapFn[string, StructWithPtrs, StructWithPtrsView]
- func (v MapView) StructWithPtrKey() map[StructWithPtrs]int
- func (v MapView) StructWithoutPtr() views.Map[string, StructWithoutPtrs]
- func (v MapView) StructWithoutPtrKey() views.Map[StructWithoutPtrs, int]
- func (v *MapView) UnmarshalJSON(b []byte) error
- func (v MapView) Valid() bool
- type OnlyGetClone
- type StructWithContainers
- type StructWithContainersView
- func (v StructWithContainersView) AsStruct() *StructWithContainers
- func (v StructWithContainersView) BasicGenericContainer() Container[GenericBasicStruct[int]]
- func (v StructWithContainersView) CloneableContainer() ContainerView[*StructWithPtrs, StructWithPtrsView]
- func (v StructWithContainersView) CloneableGenericContainer() ContainerView[*GenericNoPtrsStruct[int], GenericNoPtrsStructView[int]]
- func (v StructWithContainersView) CloneableGenericMap() MapContainerView[int, *GenericNoPtrsStruct[int], GenericNoPtrsStructView[int]]
- func (v StructWithContainersView) CloneableMap() MapContainerView[int, *StructWithPtrs, StructWithPtrsView]
- func (v StructWithContainersView) IntContainer() Container[int]
- func (v StructWithContainersView) MarshalJSON() ([]byte, error)
- func (v *StructWithContainersView) UnmarshalJSON(b []byte) error
- func (v StructWithContainersView) Valid() bool
- type StructWithEmbedded
- type StructWithEmbeddedView
- func (v StructWithEmbeddedView) A() StructWithPtrsView
- func (v StructWithEmbeddedView) AsStruct() *StructWithEmbedded
- func (v StructWithEmbeddedView) MarshalJSON() ([]byte, error)
- func (v StructWithEmbeddedView) StructWithSlices() StructWithSlicesView
- func (v *StructWithEmbeddedView) UnmarshalJSON(b []byte) error
- func (v StructWithEmbeddedView) Valid() bool
- type StructWithPtrs
- type StructWithPtrsAlias
- type StructWithPtrsAliasView
- type StructWithPtrsView
- func (v StructWithPtrsView) AsStruct() *StructWithPtrs
- func (v StructWithPtrsView) Equal(v2 StructWithPtrsView) bool
- func (v StructWithPtrsView) Int() *int
- func (v StructWithPtrsView) MarshalJSON() ([]byte, error)
- func (v StructWithPtrsView) NoCloneValue() *StructWithoutPtrs
- func (v StructWithPtrsView) String() string
- func (v *StructWithPtrsView) UnmarshalJSON(b []byte) error
- func (v StructWithPtrsView) Valid() bool
- func (v StructWithPtrsView) Value() *StructWithoutPtrs
- type StructWithSlices
- type StructWithSlicesView
- func (v StructWithSlicesView) AsStruct() *StructWithSlices
- func (v StructWithSlicesView) Data() views.ByteSlice[[]byte]
- func (v StructWithSlicesView) Ints() *int
- func (v StructWithSlicesView) MarshalJSON() ([]byte, error)
- func (v StructWithSlicesView) Prefixes() views.Slice[netip.Prefix]
- func (v StructWithSlicesView) Slice() views.Slice[string]
- func (v StructWithSlicesView) StructPointers() views.SliceView[*StructWithPtrs, StructWithPtrsView]
- func (v StructWithSlicesView) Structs() StructWithPtrs
- func (v *StructWithSlicesView) UnmarshalJSON(b []byte) error
- func (v StructWithSlicesView) Valid() bool
- func (v StructWithSlicesView) ValuePointers() views.SliceView[*StructWithoutPtrs, StructWithoutPtrsView]
- func (v StructWithSlicesView) Values() views.Slice[StructWithoutPtrs]
- type StructWithTypeAliasFields
- type StructWithTypeAliasFieldsView
- func (v StructWithTypeAliasFieldsView) AsStruct() *StructWithTypeAliasFields
- func (v StructWithTypeAliasFieldsView) MapOfSlicesWithPtrs() ...
- func (v StructWithTypeAliasFieldsView) MapOfSlicesWithoutPtrs() ...
- func (v StructWithTypeAliasFieldsView) MapWithPtrs() views.MapFn[string, *StructWithPtrsAlias, StructWithPtrsAliasView]
- func (v StructWithTypeAliasFieldsView) MapWithoutPtrs() views.MapFn[string, *StructWithoutPtrsAlias, StructWithoutPtrsAliasView]
- func (v StructWithTypeAliasFieldsView) MarshalJSON() ([]byte, error)
- func (v StructWithTypeAliasFieldsView) SliceWithPtrs() views.SliceView[*StructWithPtrsAlias, StructWithPtrsAliasView]
- func (v StructWithTypeAliasFieldsView) SliceWithoutPtrs() views.SliceView[*StructWithoutPtrsAlias, StructWithoutPtrsAliasView]
- func (v *StructWithTypeAliasFieldsView) UnmarshalJSON(b []byte) error
- func (v StructWithTypeAliasFieldsView) Valid() bool
- func (v StructWithTypeAliasFieldsView) WithPtr() StructWithPtrsView
- func (v StructWithTypeAliasFieldsView) WithPtrByPtr() StructWithPtrsAliasView
- func (v StructWithTypeAliasFieldsView) WithoutPtr() StructWithoutPtrsAlias
- func (v StructWithTypeAliasFieldsView) WithoutPtrByPtr() *StructWithoutPtrsAlias
- type StructWithoutPtrs
- type StructWithoutPtrsAlias
- type StructWithoutPtrsAliasView
- type StructWithoutPtrsView
- func (v StructWithoutPtrsView) AsStruct() *StructWithoutPtrs
- func (v StructWithoutPtrsView) Int() int
- func (v StructWithoutPtrsView) MarshalJSON() ([]byte, error)
- func (v StructWithoutPtrsView) Pfx() netip.Prefix
- func (v *StructWithoutPtrsView) UnmarshalJSON(b []byte) error
- func (v StructWithoutPtrsView) Valid() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicType ¶ added in v1.70.0
type BasicType interface { ~bool | constraints.Integer | constraints.Float | constraints.Complex | ~string }
type Container ¶ added in v1.72.0
type Container[T any] struct { Item T }
Container is a pre-defined container type, such as a collection, an optional value or a generic wrapper.
type ContainerView ¶ added in v1.72.0
type ContainerView[T views.ViewCloner[T, V], V views.StructView[T]] struct { // contains filtered or unexported fields }
ContainerView is a pre-defined readonly view of a Container[T].
func ContainerViewOf ¶ added in v1.72.0
func ContainerViewOf[T views.ViewCloner[T, V], V views.StructView[T]](c *Container[T]) ContainerView[T, V]
func (ContainerView[T, V]) Item ¶ added in v1.72.0
func (cv ContainerView[T, V]) Item() V
type GenericBasicStruct ¶ added in v1.72.0
type GenericBasicStruct[T BasicType] struct { Value T }
type GenericCloneableStruct ¶ added in v1.70.0
type GenericCloneableStruct[T views.ViewCloner[T, V], V views.StructView[T]] struct { Value T Slice []T Map map[string]T // Unsupported views. Pointer *T PtrSlice []*T PtrKeyMap map[*T]string `json:"-"` PtrValueMap map[string]*T SliceMap map[string][]T }
func (*GenericCloneableStruct[T, V]) Clone ¶ added in v1.70.0
func (src *GenericCloneableStruct[T, V]) Clone() *GenericCloneableStruct[T, V]
Clone makes a deep copy of GenericCloneableStruct. The result aliases no memory with the original.
func (*GenericCloneableStruct[T, V]) View ¶ added in v1.70.0
func (p *GenericCloneableStruct[T, V]) View() GenericCloneableStructView[T, V]
View returns a readonly view of GenericCloneableStruct.
type GenericCloneableStructView ¶ added in v1.70.0
type GenericCloneableStructView[T views.ViewCloner[T, V], V views.StructView[T]] struct { // contains filtered or unexported fields }
GenericCloneableStructView[T, V] provides a read-only view over GenericCloneableStruct[T, V].
Its methods should only be called if `Valid()` returns true.
func (GenericCloneableStructView[T, V]) AsStruct ¶ added in v1.70.0
func (v GenericCloneableStructView[T, V]) AsStruct() *GenericCloneableStruct[T, V]
AsStruct returns a clone of the underlying value which aliases no memory with the original.
func (GenericCloneableStructView[T, V]) Map ¶ added in v1.70.0
func (v GenericCloneableStructView[T, V]) Map() views.MapFn[string, T, V]
func (GenericCloneableStructView[T, V]) MarshalJSON ¶ added in v1.70.0
func (v GenericCloneableStructView[T, V]) MarshalJSON() ([]byte, error)
func (GenericCloneableStructView[T, V]) Pointer ¶ added in v1.70.0
func (v GenericCloneableStructView[T, V]) Pointer() map[string]T
func (GenericCloneableStructView[T, V]) PtrKeyMap ¶ added in v1.70.0
func (v GenericCloneableStructView[T, V]) PtrKeyMap() map[*T]string
func (GenericCloneableStructView[T, V]) PtrSlice ¶ added in v1.70.0
func (v GenericCloneableStructView[T, V]) PtrSlice() *T
func (GenericCloneableStructView[T, V]) PtrValueMap ¶ added in v1.70.0
func (v GenericCloneableStructView[T, V]) PtrValueMap() map[string]*T
func (GenericCloneableStructView[T, V]) Slice ¶ added in v1.70.0
func (v GenericCloneableStructView[T, V]) Slice() views.SliceView[T, V]
func (GenericCloneableStructView[T, V]) SliceMap ¶ added in v1.70.0
func (v GenericCloneableStructView[T, V]) SliceMap() map[string][]T
func (*GenericCloneableStructView[T, V]) UnmarshalJSON ¶ added in v1.70.0
func (v *GenericCloneableStructView[T, V]) UnmarshalJSON(b []byte) error
func (GenericCloneableStructView[T, V]) Valid ¶ added in v1.70.0
func (v GenericCloneableStructView[T, V]) Valid() bool
Valid reports whether underlying value is non-nil.
func (GenericCloneableStructView[T, V]) Value ¶ added in v1.70.0
func (v GenericCloneableStructView[T, V]) Value() V
type GenericIntStruct ¶ added in v1.70.0
type GenericIntStruct[T constraints.Integer] struct { Value T Pointer *T Slice []T Map map[string]T // Unsupported views. PtrSlice []*T PtrKeyMap map[*T]string `json:"-"` PtrValueMap map[string]*T SliceMap map[string][]T }
func (*GenericIntStruct[T]) Clone ¶ added in v1.70.0
func (src *GenericIntStruct[T]) Clone() *GenericIntStruct[T]
Clone makes a deep copy of GenericIntStruct. The result aliases no memory with the original.
func (*GenericIntStruct[T]) View ¶ added in v1.70.0
func (p *GenericIntStruct[T]) View() GenericIntStructView[T]
View returns a readonly view of GenericIntStruct.
type GenericIntStructView ¶ added in v1.70.0
type GenericIntStructView[T constraints.Integer] struct { // contains filtered or unexported fields }
GenericIntStructView[T] provides a read-only view over GenericIntStruct[T].
Its methods should only be called if `Valid()` returns true.
func (GenericIntStructView[T]) AsStruct ¶ added in v1.70.0
func (v GenericIntStructView[T]) AsStruct() *GenericIntStruct[T]
AsStruct returns a clone of the underlying value which aliases no memory with the original.
func (GenericIntStructView[T]) Map ¶ added in v1.70.0
func (v GenericIntStructView[T]) Map() views.Map[string, T]
func (GenericIntStructView[T]) MarshalJSON ¶ added in v1.70.0
func (v GenericIntStructView[T]) MarshalJSON() ([]byte, error)
func (GenericIntStructView[T]) Pointer ¶ added in v1.70.0
func (v GenericIntStructView[T]) Pointer() *T
func (GenericIntStructView[T]) PtrKeyMap ¶ added in v1.70.0
func (v GenericIntStructView[T]) PtrKeyMap() map[*T]string
func (GenericIntStructView[T]) PtrSlice ¶ added in v1.70.0
func (v GenericIntStructView[T]) PtrSlice() *T
func (GenericIntStructView[T]) PtrValueMap ¶ added in v1.70.0
func (v GenericIntStructView[T]) PtrValueMap() map[string]*T
func (GenericIntStructView[T]) Slice ¶ added in v1.70.0
func (v GenericIntStructView[T]) Slice() views.Slice[T]
func (GenericIntStructView[T]) SliceMap ¶ added in v1.70.0
func (v GenericIntStructView[T]) SliceMap() map[string][]T
func (*GenericIntStructView[T]) UnmarshalJSON ¶ added in v1.70.0
func (v *GenericIntStructView[T]) UnmarshalJSON(b []byte) error
func (GenericIntStructView[T]) Valid ¶ added in v1.70.0
func (v GenericIntStructView[T]) Valid() bool
Valid reports whether underlying value is non-nil.
func (GenericIntStructView[T]) Value ¶ added in v1.70.0
func (v GenericIntStructView[T]) Value() T
type GenericNoPtrsStruct ¶ added in v1.70.0
type GenericNoPtrsStruct[T StructWithoutPtrs | netip.Prefix | BasicType] struct { Value T Pointer *T Slice []T Map map[string]T // Unsupported views. PtrSlice []*T PtrKeyMap map[*T]string `json:"-"` PtrValueMap map[string]*T SliceMap map[string][]T }
func (*GenericNoPtrsStruct[T]) Clone ¶ added in v1.70.0
func (src *GenericNoPtrsStruct[T]) Clone() *GenericNoPtrsStruct[T]
Clone makes a deep copy of GenericNoPtrsStruct. The result aliases no memory with the original.
func (*GenericNoPtrsStruct[T]) View ¶ added in v1.70.0
func (p *GenericNoPtrsStruct[T]) View() GenericNoPtrsStructView[T]
View returns a readonly view of GenericNoPtrsStruct.
type GenericNoPtrsStructView ¶ added in v1.70.0
type GenericNoPtrsStructView[T StructWithoutPtrs | netip.Prefix | BasicType] struct { // contains filtered or unexported fields }
GenericNoPtrsStructView[T] provides a read-only view over GenericNoPtrsStruct[T].
Its methods should only be called if `Valid()` returns true.
func (GenericNoPtrsStructView[T]) AsStruct ¶ added in v1.70.0
func (v GenericNoPtrsStructView[T]) AsStruct() *GenericNoPtrsStruct[T]
AsStruct returns a clone of the underlying value which aliases no memory with the original.
func (GenericNoPtrsStructView[T]) Map ¶ added in v1.70.0
func (v GenericNoPtrsStructView[T]) Map() views.Map[string, T]
func (GenericNoPtrsStructView[T]) MarshalJSON ¶ added in v1.70.0
func (v GenericNoPtrsStructView[T]) MarshalJSON() ([]byte, error)
func (GenericNoPtrsStructView[T]) Pointer ¶ added in v1.70.0
func (v GenericNoPtrsStructView[T]) Pointer() *T
func (GenericNoPtrsStructView[T]) PtrKeyMap ¶ added in v1.70.0
func (v GenericNoPtrsStructView[T]) PtrKeyMap() map[*T]string
func (GenericNoPtrsStructView[T]) PtrSlice ¶ added in v1.70.0
func (v GenericNoPtrsStructView[T]) PtrSlice() *T
func (GenericNoPtrsStructView[T]) PtrValueMap ¶ added in v1.70.0
func (v GenericNoPtrsStructView[T]) PtrValueMap() map[string]*T
func (GenericNoPtrsStructView[T]) Slice ¶ added in v1.70.0
func (v GenericNoPtrsStructView[T]) Slice() views.Slice[T]
func (GenericNoPtrsStructView[T]) SliceMap ¶ added in v1.70.0
func (v GenericNoPtrsStructView[T]) SliceMap() map[string][]T
func (*GenericNoPtrsStructView[T]) UnmarshalJSON ¶ added in v1.70.0
func (v *GenericNoPtrsStructView[T]) UnmarshalJSON(b []byte) error
func (GenericNoPtrsStructView[T]) Valid ¶ added in v1.70.0
func (v GenericNoPtrsStructView[T]) Valid() bool
Valid reports whether underlying value is non-nil.
func (GenericNoPtrsStructView[T]) Value ¶ added in v1.70.0
func (v GenericNoPtrsStructView[T]) Value() T
type GenericTypeAliasStruct ¶ added in v1.74.0
type GenericTypeAliasStruct[T integer, T2 views.ViewCloner[T2, V2], V2 views.StructView[T2]] struct { NonCloneable T Cloneable T2 }
func (*GenericTypeAliasStruct[T, T2, V2]) Clone ¶ added in v1.74.0
func (src *GenericTypeAliasStruct[T, T2, V2]) Clone() *GenericTypeAliasStruct[T, T2, V2]
Clone makes a deep copy of GenericTypeAliasStruct. The result aliases no memory with the original.
func (*GenericTypeAliasStruct[T, T2, V2]) View ¶ added in v1.74.0
func (p *GenericTypeAliasStruct[T, T2, V2]) View() GenericTypeAliasStructView[T, T2, V2]
View returns a readonly view of GenericTypeAliasStruct.
type GenericTypeAliasStructView ¶ added in v1.74.0
type GenericTypeAliasStructView[T integer, T2 views.ViewCloner[T2, V2], V2 views.StructView[T2]] struct { // contains filtered or unexported fields }
GenericTypeAliasStructView[T, T2, V2] provides a read-only view over GenericTypeAliasStruct[T, T2, V2].
Its methods should only be called if `Valid()` returns true.
func (GenericTypeAliasStructView[T, T2, V2]) AsStruct ¶ added in v1.74.0
func (v GenericTypeAliasStructView[T, T2, V2]) AsStruct() *GenericTypeAliasStruct[T, T2, V2]
AsStruct returns a clone of the underlying value which aliases no memory with the original.
func (GenericTypeAliasStructView[T, T2, V2]) Cloneable ¶ added in v1.74.0
func (v GenericTypeAliasStructView[T, T2, V2]) Cloneable() V2
func (GenericTypeAliasStructView[T, T2, V2]) MarshalJSON ¶ added in v1.74.0
func (v GenericTypeAliasStructView[T, T2, V2]) MarshalJSON() ([]byte, error)
func (GenericTypeAliasStructView[T, T2, V2]) NonCloneable ¶ added in v1.74.0
func (v GenericTypeAliasStructView[T, T2, V2]) NonCloneable() T
func (*GenericTypeAliasStructView[T, T2, V2]) UnmarshalJSON ¶ added in v1.74.0
func (v *GenericTypeAliasStructView[T, T2, V2]) UnmarshalJSON(b []byte) error
func (GenericTypeAliasStructView[T, T2, V2]) Valid ¶ added in v1.74.0
func (v GenericTypeAliasStructView[T, T2, V2]) Valid() bool
Valid reports whether underlying value is non-nil.
type Map ¶
type Map struct { Int map[string]int SliceInt map[string][]int StructPtrWithPtr map[string]*StructWithPtrs StructPtrWithoutPtr map[string]*StructWithoutPtrs StructWithoutPtr map[string]StructWithoutPtrs SlicesWithPtrs map[string][]*StructWithPtrs SlicesWithoutPtrs map[string][]*StructWithoutPtrs StructWithoutPtrKey map[StructWithoutPtrs]int `json:"-"` StructWithPtr map[string]StructWithPtrs // Unsupported views. SliceIntPtr map[string][]*int PointerKey map[*string]int `json:"-"` StructWithPtrKey map[StructWithPtrs]int `json:"-"` }
type MapContainer ¶ added in v1.72.0
type MapContainer[K comparable, V views.Cloner[V]] struct { Items map[K]V }
MapContainer is a predefined map-like container type. Unlike Container, it has two type parameters, where the value is the second parameter.
func (*MapContainer[K, V]) Clone ¶ added in v1.72.0
func (c *MapContainer[K, V]) Clone() *MapContainer[K, V]
type MapContainerView ¶ added in v1.72.0
type MapContainerView[K comparable, T views.ViewCloner[T, V], V views.StructView[T]] struct { // contains filtered or unexported fields }
MapContainerView is a pre-defined readonly view of a MapContainer[K, T].
func MapContainerViewOf ¶ added in v1.72.0
func MapContainerViewOf[K comparable, T views.ViewCloner[T, V], V views.StructView[T]](c *MapContainer[K, T]) MapContainerView[K, T, V]
func (MapContainerView[K, T, V]) Items ¶ added in v1.72.0
func (cv MapContainerView[K, T, V]) Items() views.MapFn[K, T, V]
type MapView ¶
type MapView struct {
// contains filtered or unexported fields
}
MapView provides a read-only view over Map.
Its methods should only be called if `Valid()` returns true.
func (MapView) AsStruct ¶
AsStruct returns a clone of the underlying value which aliases no memory with the original.
func (MapView) MarshalJSON ¶
func (MapView) PointerKey ¶
func (MapView) SliceIntPtr ¶
func (MapView) SlicesWithPtrs ¶
func (v MapView) SlicesWithPtrs() views.MapFn[string, []*StructWithPtrs, views.SliceView[*StructWithPtrs, StructWithPtrsView]]
func (MapView) SlicesWithoutPtrs ¶
func (v MapView) SlicesWithoutPtrs() views.MapFn[string, []*StructWithoutPtrs, views.SliceView[*StructWithoutPtrs, StructWithoutPtrsView]]
func (MapView) StructPtrWithPtr ¶ added in v1.30.0
func (v MapView) StructPtrWithPtr() views.MapFn[string, *StructWithPtrs, StructWithPtrsView]
func (MapView) StructPtrWithoutPtr ¶ added in v1.30.0
func (v MapView) StructPtrWithoutPtr() views.MapFn[string, *StructWithoutPtrs, StructWithoutPtrsView]
func (MapView) StructWithPtr ¶
func (v MapView) StructWithPtr() views.MapFn[string, StructWithPtrs, StructWithPtrsView]
func (MapView) StructWithPtrKey ¶
func (v MapView) StructWithPtrKey() map[StructWithPtrs]int
func (MapView) StructWithoutPtr ¶
func (v MapView) StructWithoutPtr() views.Map[string, StructWithoutPtrs]
func (MapView) StructWithoutPtrKey ¶
func (v MapView) StructWithoutPtrKey() views.Map[StructWithoutPtrs, int]
func (*MapView) UnmarshalJSON ¶
type OnlyGetClone ¶ added in v1.30.0
type OnlyGetClone struct {
SinViewerPorFavor bool
}
func (*OnlyGetClone) Clone ¶ added in v1.30.0
func (src *OnlyGetClone) Clone() *OnlyGetClone
Clone makes a deep copy of OnlyGetClone. The result aliases no memory with the original.
type StructWithContainers ¶ added in v1.72.0
type StructWithContainers struct { IntContainer Container[int] CloneableContainer Container[*StructWithPtrs] BasicGenericContainer Container[GenericBasicStruct[int]] CloneableGenericContainer Container[*GenericNoPtrsStruct[int]] CloneableMap MapContainer[int, *StructWithPtrs] CloneableGenericMap MapContainer[int, *GenericNoPtrsStruct[int]] }
func (*StructWithContainers) Clone ¶ added in v1.72.0
func (src *StructWithContainers) Clone() *StructWithContainers
Clone makes a deep copy of StructWithContainers. The result aliases no memory with the original.
func (*StructWithContainers) View ¶ added in v1.72.0
func (p *StructWithContainers) View() StructWithContainersView
View returns a readonly view of StructWithContainers.
type StructWithContainersView ¶ added in v1.72.0
type StructWithContainersView struct {
// contains filtered or unexported fields
}
StructWithContainersView provides a read-only view over StructWithContainers.
Its methods should only be called if `Valid()` returns true.
func (StructWithContainersView) AsStruct ¶ added in v1.72.0
func (v StructWithContainersView) AsStruct() *StructWithContainers
AsStruct returns a clone of the underlying value which aliases no memory with the original.
func (StructWithContainersView) BasicGenericContainer ¶ added in v1.72.0
func (v StructWithContainersView) BasicGenericContainer() Container[GenericBasicStruct[int]]
func (StructWithContainersView) CloneableContainer ¶ added in v1.72.0
func (v StructWithContainersView) CloneableContainer() ContainerView[*StructWithPtrs, StructWithPtrsView]
func (StructWithContainersView) CloneableGenericContainer ¶ added in v1.72.0
func (v StructWithContainersView) CloneableGenericContainer() ContainerView[*GenericNoPtrsStruct[int], GenericNoPtrsStructView[int]]
func (StructWithContainersView) CloneableGenericMap ¶ added in v1.72.0
func (v StructWithContainersView) CloneableGenericMap() MapContainerView[int, *GenericNoPtrsStruct[int], GenericNoPtrsStructView[int]]
func (StructWithContainersView) CloneableMap ¶ added in v1.72.0
func (v StructWithContainersView) CloneableMap() MapContainerView[int, *StructWithPtrs, StructWithPtrsView]
func (StructWithContainersView) IntContainer ¶ added in v1.72.0
func (v StructWithContainersView) IntContainer() Container[int]
func (StructWithContainersView) MarshalJSON ¶ added in v1.72.0
func (v StructWithContainersView) MarshalJSON() ([]byte, error)
func (*StructWithContainersView) UnmarshalJSON ¶ added in v1.72.0
func (v *StructWithContainersView) UnmarshalJSON(b []byte) error
func (StructWithContainersView) Valid ¶ added in v1.72.0
func (v StructWithContainersView) Valid() bool
Valid reports whether underlying value is non-nil.
type StructWithEmbedded ¶ added in v1.42.0
type StructWithEmbedded struct { A *StructWithPtrs StructWithSlices }
func (*StructWithEmbedded) Clone ¶ added in v1.42.0
func (src *StructWithEmbedded) Clone() *StructWithEmbedded
Clone makes a deep copy of StructWithEmbedded. The result aliases no memory with the original.
func (*StructWithEmbedded) View ¶ added in v1.42.0
func (p *StructWithEmbedded) View() StructWithEmbeddedView
View returns a readonly view of StructWithEmbedded.
type StructWithEmbeddedView ¶ added in v1.42.0
type StructWithEmbeddedView struct {
// contains filtered or unexported fields
}
StructWithEmbeddedView provides a read-only view over StructWithEmbedded.
Its methods should only be called if `Valid()` returns true.
func (StructWithEmbeddedView) A ¶ added in v1.42.0
func (v StructWithEmbeddedView) A() StructWithPtrsView
func (StructWithEmbeddedView) AsStruct ¶ added in v1.42.0
func (v StructWithEmbeddedView) AsStruct() *StructWithEmbedded
AsStruct returns a clone of the underlying value which aliases no memory with the original.
func (StructWithEmbeddedView) MarshalJSON ¶ added in v1.42.0
func (v StructWithEmbeddedView) MarshalJSON() ([]byte, error)
func (StructWithEmbeddedView) StructWithSlices ¶ added in v1.42.0
func (v StructWithEmbeddedView) StructWithSlices() StructWithSlicesView
func (*StructWithEmbeddedView) UnmarshalJSON ¶ added in v1.42.0
func (v *StructWithEmbeddedView) UnmarshalJSON(b []byte) error
func (StructWithEmbeddedView) Valid ¶ added in v1.42.0
func (v StructWithEmbeddedView) Valid() bool
Valid reports whether underlying value is non-nil.
type StructWithPtrs ¶
type StructWithPtrs struct { Value *StructWithoutPtrs Int *int NoCloneValue *StructWithoutPtrs `codegen:"noclone"` }
func (*StructWithPtrs) Clone ¶
func (src *StructWithPtrs) Clone() *StructWithPtrs
Clone makes a deep copy of StructWithPtrs. The result aliases no memory with the original.
func (*StructWithPtrs) Equal ¶
func (v *StructWithPtrs) Equal(v2 *StructWithPtrs) bool
func (*StructWithPtrs) String ¶
func (v *StructWithPtrs) String() string
func (*StructWithPtrs) View ¶
func (p *StructWithPtrs) View() StructWithPtrsView
View returns a readonly view of StructWithPtrs.
type StructWithPtrsAlias ¶ added in v1.74.0
type StructWithPtrsAlias = StructWithPtrs
type StructWithPtrsAliasView ¶ added in v1.74.0
type StructWithPtrsAliasView = StructWithPtrsView
type StructWithPtrsView ¶
type StructWithPtrsView struct {
// contains filtered or unexported fields
}
StructWithPtrsView provides a read-only view over StructWithPtrs.
Its methods should only be called if `Valid()` returns true.
func (StructWithPtrsView) AsStruct ¶
func (v StructWithPtrsView) AsStruct() *StructWithPtrs
AsStruct returns a clone of the underlying value which aliases no memory with the original.
func (StructWithPtrsView) Equal ¶
func (v StructWithPtrsView) Equal(v2 StructWithPtrsView) bool
func (StructWithPtrsView) Int ¶
func (v StructWithPtrsView) Int() *int
func (StructWithPtrsView) MarshalJSON ¶
func (v StructWithPtrsView) MarshalJSON() ([]byte, error)
func (StructWithPtrsView) NoCloneValue ¶
func (v StructWithPtrsView) NoCloneValue() *StructWithoutPtrs
func (StructWithPtrsView) String ¶
func (v StructWithPtrsView) String() string
func (*StructWithPtrsView) UnmarshalJSON ¶
func (v *StructWithPtrsView) UnmarshalJSON(b []byte) error
func (StructWithPtrsView) Valid ¶
func (v StructWithPtrsView) Valid() bool
Valid reports whether underlying value is non-nil.
func (StructWithPtrsView) Value ¶
func (v StructWithPtrsView) Value() *StructWithoutPtrs
type StructWithSlices ¶
type StructWithSlices struct { Values []StructWithoutPtrs ValuePointers []*StructWithoutPtrs StructPointers []*StructWithPtrs Slice []string Prefixes []netip.Prefix Data []byte // Unsupported views. Structs []StructWithPtrs Ints []*int }
func (*StructWithSlices) Clone ¶
func (src *StructWithSlices) Clone() *StructWithSlices
Clone makes a deep copy of StructWithSlices. The result aliases no memory with the original.
func (*StructWithSlices) View ¶
func (p *StructWithSlices) View() StructWithSlicesView
View returns a readonly view of StructWithSlices.
type StructWithSlicesView ¶
type StructWithSlicesView struct {
// contains filtered or unexported fields
}
StructWithSlicesView provides a read-only view over StructWithSlices.
Its methods should only be called if `Valid()` returns true.
func (StructWithSlicesView) AsStruct ¶
func (v StructWithSlicesView) AsStruct() *StructWithSlices
AsStruct returns a clone of the underlying value which aliases no memory with the original.
func (StructWithSlicesView) Ints ¶
func (v StructWithSlicesView) Ints() *int
func (StructWithSlicesView) MarshalJSON ¶
func (v StructWithSlicesView) MarshalJSON() ([]byte, error)
func (StructWithSlicesView) Prefixes ¶
func (v StructWithSlicesView) Prefixes() views.Slice[netip.Prefix]
func (StructWithSlicesView) StructPointers ¶
func (v StructWithSlicesView) StructPointers() views.SliceView[*StructWithPtrs, StructWithPtrsView]
func (StructWithSlicesView) Structs ¶
func (v StructWithSlicesView) Structs() StructWithPtrs
func (*StructWithSlicesView) UnmarshalJSON ¶
func (v *StructWithSlicesView) UnmarshalJSON(b []byte) error
func (StructWithSlicesView) Valid ¶
func (v StructWithSlicesView) Valid() bool
Valid reports whether underlying value is non-nil.
func (StructWithSlicesView) ValuePointers ¶
func (v StructWithSlicesView) ValuePointers() views.SliceView[*StructWithoutPtrs, StructWithoutPtrsView]
func (StructWithSlicesView) Values ¶
func (v StructWithSlicesView) Values() views.Slice[StructWithoutPtrs]
type StructWithTypeAliasFields ¶ added in v1.74.0
type StructWithTypeAliasFields struct { WithPtr StructWithPtrsAlias WithoutPtr StructWithoutPtrsAlias WithPtrByPtr *StructWithPtrsAlias WithoutPtrByPtr *StructWithoutPtrsAlias SliceWithPtrs []*StructWithPtrsAlias SliceWithoutPtrs []*StructWithoutPtrsAlias MapWithPtrs map[string]*StructWithPtrsAlias MapWithoutPtrs map[string]*StructWithoutPtrsAlias MapOfSlicesWithPtrs map[string][]*StructWithPtrsAlias MapOfSlicesWithoutPtrs map[string][]*StructWithoutPtrsAlias }
func (*StructWithTypeAliasFields) Clone ¶ added in v1.74.0
func (src *StructWithTypeAliasFields) Clone() *StructWithTypeAliasFields
Clone makes a deep copy of StructWithTypeAliasFields. The result aliases no memory with the original.
func (*StructWithTypeAliasFields) View ¶ added in v1.74.0
func (p *StructWithTypeAliasFields) View() StructWithTypeAliasFieldsView
View returns a readonly view of StructWithTypeAliasFields.
type StructWithTypeAliasFieldsView ¶ added in v1.74.0
type StructWithTypeAliasFieldsView struct {
// contains filtered or unexported fields
}
StructWithTypeAliasFieldsView provides a read-only view over StructWithTypeAliasFields.
Its methods should only be called if `Valid()` returns true.
func (StructWithTypeAliasFieldsView) AsStruct ¶ added in v1.74.0
func (v StructWithTypeAliasFieldsView) AsStruct() *StructWithTypeAliasFields
AsStruct returns a clone of the underlying value which aliases no memory with the original.
func (StructWithTypeAliasFieldsView) MapOfSlicesWithPtrs ¶ added in v1.74.0
func (v StructWithTypeAliasFieldsView) MapOfSlicesWithPtrs() views.MapFn[string, []*StructWithPtrsAlias, views.SliceView[*StructWithPtrsAlias, StructWithPtrsAliasView]]
func (StructWithTypeAliasFieldsView) MapOfSlicesWithoutPtrs ¶ added in v1.74.0
func (v StructWithTypeAliasFieldsView) MapOfSlicesWithoutPtrs() views.MapFn[string, []*StructWithoutPtrsAlias, views.SliceView[*StructWithoutPtrsAlias, StructWithoutPtrsAliasView]]
func (StructWithTypeAliasFieldsView) MapWithPtrs ¶ added in v1.74.0
func (v StructWithTypeAliasFieldsView) MapWithPtrs() views.MapFn[string, *StructWithPtrsAlias, StructWithPtrsAliasView]
func (StructWithTypeAliasFieldsView) MapWithoutPtrs ¶ added in v1.74.0
func (v StructWithTypeAliasFieldsView) MapWithoutPtrs() views.MapFn[string, *StructWithoutPtrsAlias, StructWithoutPtrsAliasView]
func (StructWithTypeAliasFieldsView) MarshalJSON ¶ added in v1.74.0
func (v StructWithTypeAliasFieldsView) MarshalJSON() ([]byte, error)
func (StructWithTypeAliasFieldsView) SliceWithPtrs ¶ added in v1.74.0
func (v StructWithTypeAliasFieldsView) SliceWithPtrs() views.SliceView[*StructWithPtrsAlias, StructWithPtrsAliasView]
func (StructWithTypeAliasFieldsView) SliceWithoutPtrs ¶ added in v1.74.0
func (v StructWithTypeAliasFieldsView) SliceWithoutPtrs() views.SliceView[*StructWithoutPtrsAlias, StructWithoutPtrsAliasView]
func (*StructWithTypeAliasFieldsView) UnmarshalJSON ¶ added in v1.74.0
func (v *StructWithTypeAliasFieldsView) UnmarshalJSON(b []byte) error
func (StructWithTypeAliasFieldsView) Valid ¶ added in v1.74.0
func (v StructWithTypeAliasFieldsView) Valid() bool
Valid reports whether underlying value is non-nil.
func (StructWithTypeAliasFieldsView) WithPtr ¶ added in v1.74.0
func (v StructWithTypeAliasFieldsView) WithPtr() StructWithPtrsView
func (StructWithTypeAliasFieldsView) WithPtrByPtr ¶ added in v1.74.0
func (v StructWithTypeAliasFieldsView) WithPtrByPtr() StructWithPtrsAliasView
func (StructWithTypeAliasFieldsView) WithoutPtr ¶ added in v1.74.0
func (v StructWithTypeAliasFieldsView) WithoutPtr() StructWithoutPtrsAlias
func (StructWithTypeAliasFieldsView) WithoutPtrByPtr ¶ added in v1.74.0
func (v StructWithTypeAliasFieldsView) WithoutPtrByPtr() *StructWithoutPtrsAlias
type StructWithoutPtrs ¶
func (*StructWithoutPtrs) Clone ¶
func (src *StructWithoutPtrs) Clone() *StructWithoutPtrs
Clone makes a deep copy of StructWithoutPtrs. The result aliases no memory with the original.
func (*StructWithoutPtrs) View ¶
func (p *StructWithoutPtrs) View() StructWithoutPtrsView
View returns a readonly view of StructWithoutPtrs.
type StructWithoutPtrsAlias ¶ added in v1.74.0
type StructWithoutPtrsAlias = StructWithoutPtrs
type StructWithoutPtrsAliasView ¶ added in v1.74.0
type StructWithoutPtrsAliasView = StructWithoutPtrsView
type StructWithoutPtrsView ¶
type StructWithoutPtrsView struct {
// contains filtered or unexported fields
}
StructWithoutPtrsView provides a read-only view over StructWithoutPtrs.
Its methods should only be called if `Valid()` returns true.
func (StructWithoutPtrsView) AsStruct ¶
func (v StructWithoutPtrsView) AsStruct() *StructWithoutPtrs
AsStruct returns a clone of the underlying value which aliases no memory with the original.
func (StructWithoutPtrsView) Int ¶
func (v StructWithoutPtrsView) Int() int
func (StructWithoutPtrsView) MarshalJSON ¶
func (v StructWithoutPtrsView) MarshalJSON() ([]byte, error)
func (StructWithoutPtrsView) Pfx ¶
func (v StructWithoutPtrsView) Pfx() netip.Prefix
func (*StructWithoutPtrsView) UnmarshalJSON ¶
func (v *StructWithoutPtrsView) UnmarshalJSON(b []byte) error
func (StructWithoutPtrsView) Valid ¶
func (v StructWithoutPtrsView) Valid() bool
Valid reports whether underlying value is non-nil.