Documentation ¶
Overview ¶
Package tests serves a list of tests for tailscale.com/cmd/viewer.
Index ¶
- type Map
- 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.MapFn[string, []int, views.Slice[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 StructWithPtrs
- 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() mem.RO
- func (v StructWithSlicesView) Ints() *int
- func (v StructWithSlicesView) MarshalJSON() ([]byte, error)
- func (v StructWithSlicesView) Prefixes() views.IPPrefixSlice
- 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 StructWithoutPtrs
- 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 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:"-"` // Unsupported views. SliceIntPtr map[string][]*int PointerKey map[*string]int `json:"-"` StructWithPtrKey map[StructWithPtrs]int `json:"-"` StructWithPtr map[string]StructWithPtrs }
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 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 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 Structs []StructWithPtrs Ints []*int Slice []string Prefixes []netip.Prefix Data []byte }
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) Data ¶
func (v StructWithSlicesView) Data() mem.RO
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.IPPrefixSlice
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 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 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.