util

package
v0.0.0-...-a3dd185 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Overview

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

Index

Constants

View Source
const (
	EnvPrefix = "FLOW"
)

Variables

This section is empty.

Functions

func AbsolutePath

func AbsolutePath(basePath, filePath string) string

func AddToGitIgnore

func AddToGitIgnore(filename string, loader ReaderWriter) error

AddToGitIgnore adds a new line to the .gitignore if one doesn't exist it creates it.

func CreateTabWriter

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 GetAddressNetwork

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

GetAddressNetwork returns the chain ID for an address.

func ParseAddress

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

func RandomSeed

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

func RemoveFromStringArray

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

func ValidateECDSAP256Pub

func ValidateECDSAP256Pub(key string) error

ValidateECDSAP256Pub attempt to decode the hex string representation of a ECDSA P256 public key

Types

type ReaderWriter

type ReaderWriter interface {
	ReadFile(source string) ([]byte, error)
	WriteFile(filename string, data []byte, perm os.FileMode) error
}

type ScriptQuery

type ScriptQuery struct {
	ID     flow.Identifier
	Height uint64
}

Jump to

Keyboard shortcuts

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