util

package
v0.0.2 Latest Latest
Warning

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

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

Documentation

Overview

Copyright 2022 The Amesh Authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenNodeId

func GenNodeId(runId, ipAddr, dnsDomain string) string

GenNodeId generates an id used for xDS protocol. The format is like: sidecar~172.10.0.2~12345asad034~default.svc.cluster.local

Types

type Manifest

type Manifest struct {
	Routes    []*apisix.Route
	Upstreams []*apisix.Upstream
}

Manifest collects a couples Routes, Upstreams.

func (*Manifest) DiffFrom

func (m *Manifest) DiffFrom(m2 *Manifest) (*Manifest, *Manifest, *Manifest)

DiffFrom checks the difference between m and m2 from m's point of view.

func (*Manifest) Events

func (m *Manifest) Events(evType types.EventType) []types.Event

Events generates events according to its collection.

func (*Manifest) Size

func (m *Manifest) Size() int

Size calculates the number of resources in the manifest.

type StringSet

type StringSet map[string]struct{}

StringSet represents a set which elements are string.

func (StringSet) Add

func (set StringSet) Add(e string)

Add adds an element to set.

func (StringSet) Equals

func (set StringSet) Equals(set2 StringSet) bool

Equals compares two string set and checks whether they are identical.

func (StringSet) OrderedStrings

func (set StringSet) OrderedStrings() []string

OrderedStrings converts the string set to a sorted string slice.

func (StringSet) Strings

func (set StringSet) Strings() []string

Strings converts the string set to a string slice.

Jump to

Keyboard shortcuts

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