helpers

package
v0.0.1-ptppoc Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// SSHKeySize is the size (in bytes) of SSH key to create
	SSHKeySize = 4096

	// DefaultPkiKeySize is the default size in bytes of the PKI key
	DefaultPkiKeySize = 4096
)

Variables

This section is empty.

Functions

func GetAzureLocations

func GetAzureLocations() []string

GetAzureLocations provides all azure regions in prod. Related powershell to refresh this list:

Get-AzureRmLocation | Select-Object -Property Location

func GetCloudTargetEnv

func GetCloudTargetEnv(location string) string

GetCloudTargetEnv determines and returns whether the region is a sovereign cloud which have their own data compliance regulations (China/Germany/USGov) or standard Azure public cloud

func GetHomeDir

func GetHomeDir() string

GetHomeDir attempts to get the home dir from env

func GetTargetEnv

func GetTargetEnv(location, customCloudName string) string

GetTargetEnv determines and returns whether the region is a sovereign cloud which have their own data compliance regulations (China/Germany/USGov) or standard Azure public cloud CustomCloudName is name of environment if customCloudProfile is provided, it will be empty string if customCloudProfile is empty. Because customCloudProfile is empty for deployment for AzurePublicCloud, AzureChinaCloud,AzureGermanCloud,AzureUSGovernmentCloud, The customCloudName value will be empty string for those clouds

func JSONMarshal

func JSONMarshal(content interface{}, escape bool) ([]byte, error)

JSONMarshal marshals JSON w/ optional SetEscapeHTML

func JSONMarshalIndent

func JSONMarshalIndent(content interface{}, prefix, indent string, escape bool) ([]byte, error)

JSONMarshalIndent marshals formatted JSON w/ optional SetEscapeHTML

Types

type FileSaver

type FileSaver struct{}

FileSaver represents the object that save string or byte data to file

func (*FileSaver) SaveFile

func (f *FileSaver) SaveFile(dir string, file string, data []byte) error

SaveFile saves binary data to file

func (*FileSaver) SaveFileString

func (f *FileSaver) SaveFileString(dir string, file string, data string) error

SaveFileString saves string to file

Jump to

Keyboard shortcuts

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