diff options
Diffstat (limited to 'types/dnstype')
| -rw-r--r-- | types/dnstype/dnstype.go | 1 | ||||
| -rw-r--r-- | types/dnstype/dnstype_view.go | 30 |
2 files changed, 31 insertions, 0 deletions
diff --git a/types/dnstype/dnstype.go b/types/dnstype/dnstype.go index e1f9e9fdb..9bef2c039 100644 --- a/types/dnstype/dnstype.go +++ b/types/dnstype/dnstype.go @@ -6,6 +6,7 @@ package dnstype //go:generate go run tailscale.com/cmd/cloner --type=Resolver --clonefunc=true --output=dnstype_clone.go +//go:generate go run tailscale.com/cmd/viewer --type=Resolver --output=dnstype_view.go import "inet.af/netaddr" diff --git a/types/dnstype/dnstype_view.go b/types/dnstype/dnstype_view.go new file mode 100644 index 000000000..fe63bb2a5 --- /dev/null +++ b/types/dnstype/dnstype_view.go @@ -0,0 +1,30 @@ +// Copyright (c) 2021 Tailscale Inc & AUTHORS All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Code generated by the following command; DO NOT EDIT. +// tailscale.com/cmd/viewer -type Resolver + +package dnstype + +import ( + "inet.af/netaddr" +) + +// View makes a readonly view of Resolver. +func (src *Resolver) View() ResolverView { + return ResolverView{src} +} + +// ResolverView is a readonly view of Resolver. +type ResolverView struct{ ж *Resolver } + +func (v ResolverView) Valid() bool { return v.ж != nil } +func (v ResolverView) Addr() string { return v.ж.Addr } +func (v ResolverView) BootstrapResolution() []netaddr.IP { return v.ж.BootstrapResolution } + +// A compilation failure here means this code must be regenerated, with the command at the top of this file. +var _ResolverViewNeedsRegeneration = Resolver(struct { + Addr string + BootstrapResolution []netaddr.IP +}{}) |
