views

package
v1.24.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: BSD-3-Clause Imports: 4 Imported by: 47

Documentation

Overview

Package views provides read-only accessors for commonly used value types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPPrefixSlice

type IPPrefixSlice struct {
	// contains filtered or unexported fields
}

IPPrefixSlice is a read-only accessor for a slice of netaddr.IPPrefix.

func IPPrefixSliceOf

func IPPrefixSliceOf(x []netaddr.IPPrefix) IPPrefixSlice

IPPrefixSliceOf returns a IPPrefixSlice for the provided slice.

func (IPPrefixSlice) AppendTo

func (v IPPrefixSlice) AppendTo(dst []netaddr.IPPrefix) []netaddr.IPPrefix

AppendTo appends the underlying slice values to dst.

func (IPPrefixSlice) AsSlice

func (v IPPrefixSlice) AsSlice() []netaddr.IPPrefix

AsSlice returns a copy of underlying slice.

func (IPPrefixSlice) At

At returns the IPPrefix at index `i` of the slice.

func (IPPrefixSlice) ContainsExitRoutes added in v1.24.0

func (v IPPrefixSlice) ContainsExitRoutes() bool

ContainsExitRoutes reports whether v contains ExitNode Routes.

func (IPPrefixSlice) ContainsFunc

func (v IPPrefixSlice) ContainsFunc(f func(netaddr.IPPrefix) bool) bool

PrefixesContainsFunc reports whether f is true for any IPPrefix in the slice.

func (IPPrefixSlice) ContainsIP

func (v IPPrefixSlice) ContainsIP(ip netaddr.IP) bool

PrefixesContainsIP reports whether any IPPrefix contains IP.

func (IPPrefixSlice) IsNil

func (v IPPrefixSlice) IsNil() bool

IsNil reports whether the underlying slice is nil.

func (IPPrefixSlice) Len

func (v IPPrefixSlice) Len() int

Len returns the length of the slice.

func (IPPrefixSlice) MarshalJSON

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

MarshalJSON implements json.Marshaler.

func (*IPPrefixSlice) UnmarshalJSON

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

UnmarshalJSON implements json.Unmarshaler.

func (IPPrefixSlice) Unwrap added in v1.24.0

func (v IPPrefixSlice) Unwrap() Slice[netaddr.IPPrefix]

Unwrap returns the underlying Slice[netaddr.IPPrefix].

type Slice added in v1.24.0

type Slice[T any] struct {
	// contains filtered or unexported fields
}

Slice is a read-only accessor for a slice.

func SliceOf added in v1.24.0

func SliceOf[T any](x []T) Slice[T]

SliceOf returns a Slice for the provided slice.

func (Slice[T]) AppendTo added in v1.24.0

func (v Slice[T]) AppendTo(dst []T) []T

AppendTo appends the underlying slice values to dst.

func (Slice[T]) AsSlice added in v1.24.0

func (v Slice[T]) AsSlice() []T

AsSlice returns a copy of underlying slice.

func (Slice[T]) At added in v1.24.0

func (v Slice[T]) At(i int) T

At returns the element at index `i` of the slice.

func (Slice[T]) IsNil added in v1.24.0

func (v Slice[T]) IsNil() bool

IsNil reports whether the underlying slice is nil.

func (Slice[T]) Len added in v1.24.0

func (v Slice[T]) Len() int

Len returns the length of the slice.

func (Slice[T]) MarshalJSON added in v1.24.0

func (v Slice[T]) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*Slice[T]) UnmarshalJSON added in v1.24.0

func (v *Slice[T]) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

Jump to

Keyboard shortcuts

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