tests

package
v1.66.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package tests serves a list of tests for tailscale.com/cmd/viewer.

Index

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
}

func (*Map) Clone

func (src *Map) Clone() *Map

Clone makes a deep copy of Map. The result aliases no memory with the original.

func (*Map) View

func (p *Map) View() MapView

View returns a readonly view of Map.

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

func (v MapView) AsStruct() *Map

AsStruct returns a clone of the underlying value which aliases no memory with the original.

func (MapView) Int

func (v MapView) Int() views.Map[string, int]

func (MapView) MarshalJSON

func (v MapView) MarshalJSON() ([]byte, error)

func (MapView) PointerKey

func (v MapView) PointerKey() map[*string]int

func (MapView) SliceInt

func (v MapView) SliceInt() views.MapFn[string, []int, views.Slice[int]]

func (MapView) SliceIntPtr

func (v MapView) SliceIntPtr() map[string][]*int

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 (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

func (v *MapView) UnmarshalJSON(b []byte) error

func (MapView) Valid

func (v MapView) Valid() bool

Valid reports whether underlying value is non-nil.

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 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

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 (StructWithEmbeddedView) AsStruct added in v1.42.0

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

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 (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

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

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 (StructWithSlicesView) Ints

func (v StructWithSlicesView) Ints() *int

func (StructWithSlicesView) MarshalJSON

func (v StructWithSlicesView) MarshalJSON() ([]byte, error)

func (StructWithSlicesView) Prefixes

func (StructWithSlicesView) Slice

func (StructWithSlicesView) StructPointers

func (StructWithSlicesView) Structs

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 (StructWithSlicesView) Values

type StructWithoutPtrs

type StructWithoutPtrs struct {
	Int int
	Pfx netip.Prefix
}

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

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

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 (*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.

Jump to

Keyboard shortcuts

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