utils

package
v1.10.29 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: Apache-2.0 Imports: 3 Imported by: 8

Documentation

Overview

Package utils provides common utilities for the use of other packages in oasdiff.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeTemplatedPath added in v1.5.13

func NormalizeTemplatedPath(path string) (string, uint, []string)

NormalizeTemplatedPath converts a path to its normalized form, without parameter names

For example: /person/{personName} -> /person/{}

Return values: 1. The normalized path 2. Number of params 3. List of param names

This implementation is based on Paths.normalizeTemplatedPath in openapi3

Types

type StringList

type StringList []string

StringList is a list of string values

func (*StringList) CartesianProduct added in v1.10.6

func (stringList *StringList) CartesianProduct(other StringList) []StringPair

func (*StringList) Contains added in v1.3.17

func (stringList *StringList) Contains(s string) bool

func (*StringList) Empty added in v1.5.15

func (stringList *StringList) Empty() bool

Empty indicates whether a change was found in this element

func (*StringList) Is added in v1.10.15

func (stringList *StringList) Is(s string) bool

func (StringList) Len added in v1.3.17

func (list StringList) Len() int

Len implements the sort.Interface interface

func (StringList) Less added in v1.3.17

func (list StringList) Less(i, j int) bool

Less implements the sort.Interface interface

func (*StringList) Minus added in v1.3.17

func (stringList *StringList) Minus(other StringList) StringList

func (*StringList) Set

func (stringList *StringList) Set(s string) error

func (StringList) Sort added in v1.3.17

func (list StringList) Sort() StringList

func (*StringList) String

func (stringList *StringList) String() string

func (StringList) Swap added in v1.3.17

func (list StringList) Swap(i, j int)

Swap implements the sort.Interface interface

func (StringList) ToStringSet added in v1.3.17

func (list StringList) ToStringSet() StringSet

type StringMap added in v1.3.17

type StringMap map[string]string

StringMap is a map of string to string

type StringPair added in v1.10.6

type StringPair struct {
	X string
	Y string
}

type StringSet added in v1.3.17

type StringSet map[string]struct{}

StringSet is a set of string values

func (StringSet) Add added in v1.3.17

func (stringSet StringSet) Add(s string)

func (StringSet) Contains added in v1.3.17

func (stringSet StringSet) Contains(s string) bool

func (StringSet) Copy added in v1.5.13

func (stringSet StringSet) Copy() StringSet

func (StringSet) Empty added in v1.3.17

func (stringSet StringSet) Empty() bool

Empty indicates whether a change was found in this element

func (StringSet) Equals added in v1.3.17

func (stringSet StringSet) Equals(other StringSet) bool

func (StringSet) Intersection added in v1.5.13

func (stringSet StringSet) Intersection(other StringSet) StringSet

func (StringSet) Minus added in v1.3.17

func (stringSet StringSet) Minus(other StringSet) StringSet

func (StringSet) Plus added in v1.5.13

func (stringSet StringSet) Plus(other StringSet) StringSet

func (StringSet) ToStringList added in v1.3.17

func (stringSet StringSet) ToStringList() StringList

type VisitedRefs added in v1.5.0

type VisitedRefs map[string]struct{}

func (VisitedRefs) Add added in v1.5.0

func (v VisitedRefs) Add(refName string)

func (VisitedRefs) IsVisited added in v1.5.0

func (v VisitedRefs) IsVisited(refName string) bool

func (VisitedRefs) Remove added in v1.5.0

func (v VisitedRefs) Remove(refName string)

Jump to

Keyboard shortcuts

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