finder

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2018 License: MPL-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StripDefaultNS

func StripDefaultNS(v string) string

StripDefaultNS strips the default namespace from an argument. For now, the API and lookups strip this value from string output so we strip it.

Types

type Finder

type Finder struct {
	// Client is the API client to use for any requests.
	Client *api.Client
	// contains filtered or unexported fields
}

Finder finds intentions by a src/dst exact match. There is currently no direct API to do this so this struct downloads all intentions and caches them once, and searches in-memory for this. For now this works since even with a very large number of intentions, the size of the data gzipped over HTTP will be relatively small.

The Finder will only downlaod the intentions one time. This struct is not expected to be used over a long period of time. Though it may be reused multile times, the intentions list is only downloaded once.

func (*Finder) Find

func (f *Finder) Find(src, dst string) (*api.Intention, error)

Find finds the intention that matches the given src and dst. This will return nil when the result is not found.

func (*Finder) IDFromArgs

func (f *Finder) IDFromArgs(args []string) (string, error)

ID returns the intention ID for the given CLI args. An error is returned if args is not 1 or 2 elements.

Jump to

Keyboard shortcuts

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