utils

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

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

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) Contains

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

func (*StringList) Empty

func (stringList *StringList) Empty() bool

Empty indicates whether a change was found in this element

func (StringList) Len

func (list StringList) Len() int

Len implements the sort.Interface interface

func (StringList) Less

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

Less implements the sort.Interface interface

func (*StringList) Minus

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

func (*StringList) Set

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

func (StringList) Sort

func (list StringList) Sort() StringList

func (*StringList) String

func (stringList *StringList) String() string

func (StringList) Swap

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

Swap implements the sort.Interface interface

func (StringList) ToStringSet

func (list StringList) ToStringSet() StringSet

type StringMap

type StringMap map[string]string

StringMap is a map of string to string

type StringSet

type StringSet map[string]struct{}

StringSet is a set of string values

func (StringSet) Add

func (stringSet StringSet) Add(s string)

func (StringSet) Contains

func (stringSet StringSet) Contains(s string) bool

func (StringSet) Copy

func (stringSet StringSet) Copy() StringSet

func (StringSet) Empty

func (stringSet StringSet) Empty() bool

Empty indicates whether a change was found in this element

func (StringSet) Equals

func (stringSet StringSet) Equals(other StringSet) bool

func (StringSet) Intersection

func (stringSet StringSet) Intersection(other StringSet) StringSet

func (StringSet) Minus

func (stringSet StringSet) Minus(other StringSet) StringSet

func (StringSet) Plus

func (stringSet StringSet) Plus(other StringSet) StringSet

func (StringSet) ToStringList

func (stringSet StringSet) ToStringList() StringList

type VisitedRefs

type VisitedRefs map[string]struct{}

func (VisitedRefs) Add

func (v VisitedRefs) Add(refName string)

func (VisitedRefs) IsVisited

func (v VisitedRefs) IsVisited(refName string) bool

func (VisitedRefs) Remove

func (v VisitedRefs) Remove(refName string)

Jump to

Keyboard shortcuts

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