utils

package
v0.0.0-...-69eaee5 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExceptionRegexpsRaw = map[string]versionComparator{

	`([0-9]+)\.v?([a-z0-9]+)`: func(i, j []string) (bool, error) {
		xi, err := strconv.Atoi(i[1])
		if err != nil {
			return false, errors.Errorf("malformed version: %s in %v is not an integer", i[1], i)
		}
		xj, err := strconv.Atoi(j[1])
		if err != nil {
			return false, errors.Errorf("malformed version: %s in %v is not an integer", i[1], i)
		}
		return xi < xj, nil
	},
}

ExceptionRegexpsRaw are the raw regular expressions that we know are exceptions to standard version formats.

Functions

func FileExists

func FileExists(filename string) (bool, error)

FileExists will test if a file exists

func MarshalJSON

func MarshalJSON(filename string, pb proto.Message) error

MarshalJSON marshals a protocol buffer into a JSON file.

func UnmarshalFile

func UnmarshalFile(filename string, pb proto.Message) error

UnmarshalFile unmarshals a file into a protocol buffer

func UnmarshalJSON

func UnmarshalJSON(filename string, pb proto.Message) error

UnmarshalJSON unmarshals a JSON file into a protocol buffer

func UnmarshalJsonnet

func UnmarshalJsonnet(filename string, pb proto.Message) error

UnmarshalJsonnet unmarshals a JSON file into a protocol buffer

func UnmarshalYAML

func UnmarshalYAML(filename string, pb proto.Message) error

UnmarshalYAML unmarshals a YAML file into a protocol buffer

func VersionLower

func VersionLower(i string, j string) (bool, error)

VersionLower returns whether i version is lower than j version

Types

This section is empty.

Jump to

Keyboard shortcuts

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