util

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2021 License: Apache-2.0 Imports: 12 Imported by: 60

Documentation

Overview

Package util implements different utilities

Package util implements different utilities

Package util implements different utilities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseAndVerifyToken added in v0.3.3

func ParseAndVerifyToken(ctx context.Context, jwksURL string) (jwt.Token, error)

ParseAndVerifyToken parse the given token and verifies the signature ctx: Mandatory - the context jwksURL: Mandatory - the URL to where the public keys are stored Returns either the parsed and verified token or error if something goes wrong

func PrintError

func PrintError(message string)

PrintError prints 'message' with red color text message: Message to be printed

func PrintIfError

func PrintIfError(err error)

PrintIfError print the error message if the provided err has valid error value err: Optinal. The error to be printed

func PrintInfo

func PrintInfo(message string)

PrintInfo prints a 'message' with cSkyyblue color text message: Message to be printed

func PrintSuccess

func PrintSuccess(message string)

PrintSuccess prints 'message' with green color text message: Message to be printed

func PrintYAML

func PrintYAML(obj interface{})

PrintYAML takes input object, marshal it using YAML format and prints it into standard output obj: Mandatory. Reference to the object to be printed

Types

type Version

type Version struct {
	Version       string
	Platform      string
	Commit        string
	Date          string
	GolangVersion string
}

Version defines the structure containns all information to be printed when 'version' command is requested.

func GetVersion

func GetVersion() Version

GetVersion returns the version information Returns the version inforamtion

Jump to

Keyboard shortcuts

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