util

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package cli defines constants, configurations, and utilities that are used across the Flow CLI.

Index

Constants

View Source
const (
	EnvPrefix = "FLOW"
)

Variables

View Source
var Bold = color.New(color.FgCyan).SprintfFunc()
View Source
var Green = color.New(color.FgGreen, color.Bold).SprintfFunc()
View Source
var Red = color.New(color.FgRed, color.Bold).SprintfFunc()

Functions

func ContainsString added in v0.18.0

func ContainsString(s []string, e string) bool

func ConvertSigAndHashAlgo

func ConvertSigAndHashAlgo(
	signatureAlgorithm string,
	hashingAlgorithm string,
) (crypto.SignatureAlgorithm, crypto.HashAlgorithm, error)

ConvertSigAndHashAlgo parses and validates a signature and hash algorithm pair.

func CreateTabWriter added in v0.19.0

func CreateTabWriter(b *bytes.Buffer) *tabwriter.Writer

func EnvFromNetwork

func EnvFromNetwork(network flow.ChainID) templates.Environment

func Exit

func Exit(code int, msg string)

func Exitf

func Exitf(code int, msg string, args ...interface{})

func GcloudApplicationSignin

func GcloudApplicationSignin(resourceID string) error

GcloudApplicationSignin signs in as an application user using gcloud command line tool currently assumes gcloud is already installed on the machine will by default pop a browser window to sign in

func GetAddressNetwork

func GetAddressNetwork(address flow.Address) (flow.ChainID, error)

GetAddressNetwork returns the chain ID for an address.

func IsByteSlice

func IsByteSlice(v interface{}) bool

func LoadFile

func LoadFile(filename string) ([]byte, error)

LoadFile loads a file by filename.

func ParseAddress added in v0.18.0

func ParseAddress(value string) (flow.Address, bool)

func RandomSeed

func RandomSeed(n int) ([]byte, error)

func RemoveFromStringArray added in v0.19.0

func RemoveFromStringArray(s []string, el string) []string

func StringContains

func StringContains(s []string, e string) bool

StringContains returns true if the slice contains the given string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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