util

package
v0.0.0-...-123e828 Latest Latest
Warning

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

Go to latest
Published: May 1, 2019 License: GPL-3.0, Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToCanonicalName

func ToCanonicalName(name string) string

ToCanonicalName converts Golang package/type name into canonical OpenAPI name. Examples:

Input:  k8s.io/api/core/v1.Pod
Output: io.k8s.api.core.v1.Pod

Input:  k8s.io/api/core/v1
Output: io.k8s.api.core.v1

Types

type Trie

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

A simple trie implementation with Add and HasPrefix methods only.

func NewTrie

func NewTrie(list []string) Trie

NewTrie creates a Trie and add all strings in the provided list to it.

func (*Trie) Add

func (t *Trie) Add(v string)

Add adds a word to this trie

func (*Trie) GetPrefix

func (t *Trie) GetPrefix(v string) (string, bool)

GetPrefix is like HasPrefix but return the prefix in case of match or empty string otherwise.

func (*Trie) HasPrefix

func (t *Trie) HasPrefix(v string) bool

HasPrefix returns true of v has any of the prefixes stored in this trie.

Directories

Path Synopsis
Package proto is a collection of libraries for parsing and indexing the type definitions.
Package proto is a collection of libraries for parsing and indexing the type definitions.

Jump to

Keyboard shortcuts

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