vips

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OriginHost    = "host"
	OriginService = "service"
	OriginKube    = "kubernetes"
)
View Source
const (
	Add    = ChangeType("Add")
	Remove = ChangeType("Remove")
	Modify = ChangeType("Modify")
)

Variables

View Source
var OriginVirtualOutbound = func(name string) string { return "virtual-outbound:" + name }

Functions

func ConfigKey

func ConfigKey(mesh string) string

func MeshFromConfigKey

func MeshFromConfigKey(name string) (string, bool)

Types

type Change added in v1.8.1

type Change struct {
	Type  ChangeType
	Entry HostnameEntry
}

func (Change) String added in v1.8.1

func (c Change) String() string

type ChangeType added in v1.8.1

type ChangeType string

type EntryType added in v1.8.1

type EntryType int
const (
	Service EntryType = iota
	Host
	FullyQualifiedDomain
)

func (EntryType) String added in v1.8.1

func (t EntryType) String() string

type GlobalView added in v1.8.1

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

GlobalView keeps a list of all hostname/ips and add the possibility to allocate new ips

func NewGlobalView added in v1.8.1

func NewGlobalView(cidr string) (*GlobalView, error)

func (*GlobalView) Allocate added in v1.8.1

func (g *GlobalView) Allocate(hostname HostnameEntry) (string, error)

Allocate assign an ip to a host

func (*GlobalView) Reserve added in v1.8.1

func (g *GlobalView) Reserve(hostname HostnameEntry, ip string) error

Reserve add an ip/host to the list of reserved ips (useful when loading an existing view).

func (*GlobalView) ToVIPMap added in v1.8.1

func (g *GlobalView) ToVIPMap() map[HostnameEntry]string

type HostnameEntry added in v1.8.1

type HostnameEntry struct {
	Type EntryType `json:"type"`
	Name string    `json:"name"`
}

HostnameEntry is the definition of a DNS entry. The type indicates where the entry comes from (.e.g: Service is auto-generated, FullyQualifiedDomain comes from `virtual-outbound` policies...)

func NewFqdnEntry added in v1.8.1

func NewFqdnEntry(name string) HostnameEntry

func NewHostEntry added in v1.8.1

func NewHostEntry(host string) HostnameEntry

func NewServiceEntry added in v1.8.1

func NewServiceEntry(name string) HostnameEntry

func (*HostnameEntry) Less added in v1.8.1

func (e *HostnameEntry) Less(o *HostnameEntry) bool

func (HostnameEntry) MarshalText added in v1.8.1

func (e HostnameEntry) MarshalText() (text []byte, err error)

func (HostnameEntry) String added in v1.8.1

func (e HostnameEntry) String() string

func (*HostnameEntry) UnmarshalText added in v1.8.1

func (e *HostnameEntry) UnmarshalText(text []byte) error

type OutboundEntry added in v1.8.1

type OutboundEntry struct {
	Port   uint32
	TagSet map[string]string
	// A string to identify where this outbound was defined (usually the name of the outbound policy)
	Origin string
}

func (*OutboundEntry) Less added in v1.8.1

func (mo *OutboundEntry) Less(o *OutboundEntry) bool

func (*OutboundEntry) String added in v1.8.1

func (mo *OutboundEntry) String() string

type Persistence

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

func NewPersistence

func NewPersistence(resourceManager manager.ReadOnlyResourceManager, configManager config_manager.ConfigManager) *Persistence

func (*Persistence) GetByMesh

func (m *Persistence) GetByMesh(ctx context.Context, mesh string) (*VirtualOutboundMeshView, error)

func (*Persistence) Set

type VirtualOutbound added in v1.8.1

type VirtualOutbound struct {
	// This is not default in the legacy case (hostnames won't be complete)
	Address   string          `json:"address,omitempty"`
	Outbounds []OutboundEntry `json:"outbounds,omitempty"`
}

VirtualOutbound the description of a hostname -> address and a list of port/tagSet that identifies each outbound.

func (*VirtualOutbound) Equal added in v1.8.1

func (vo *VirtualOutbound) Equal(other *VirtualOutbound) bool

type VirtualOutboundMeshView added in v1.8.1

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

func NewEmptyVirtualOutboundView added in v1.8.1

func NewEmptyVirtualOutboundView() *VirtualOutboundMeshView

func NewVirtualOutboundView added in v1.8.1

func NewVirtualOutboundView(all map[HostnameEntry]VirtualOutbound) (*VirtualOutboundMeshView, error)

func (*VirtualOutboundMeshView) Add added in v1.8.1

func (vo *VirtualOutboundMeshView) Add(entry HostnameEntry, outbound OutboundEntry) error

func (*VirtualOutboundMeshView) DeleteByOrigin added in v1.8.1

func (vo *VirtualOutboundMeshView) DeleteByOrigin(origin string)

func (*VirtualOutboundMeshView) Get added in v1.8.1

func (*VirtualOutboundMeshView) HostnameEntries added in v1.8.1

func (vo *VirtualOutboundMeshView) HostnameEntries() []HostnameEntry

func (*VirtualOutboundMeshView) Update added in v1.8.1

Update merges `new` and `vo` in a new `out` and returns a list of changes.

Jump to

Keyboard shortcuts

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