files

package
v0.0.0-...-f15f0a0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateObfuscatedFilePath

func GenerateObfuscatedFilePath(
	fileExtension string,
	workspaceID uuid.UUID,
	resourceName string,
	resourceID *uuid.UUID,
) (string, error)

GenerateObfuscatedFilePath generates an obfuscated filepath using the following schemes:

[workspace-id-shortened]/[resource-name].[random-id-shortened].[file-extension]

[workspace-id-shortened]/[resource-name].[resource-id-shortened].[random-id-shortened].[file-extension]

func OpenFile

func OpenFile(path string, isAppend bool) (*os.File, error)

OpenFile opens specified file.

func OpenOrCreateFile

func OpenOrCreateFile(path string, isAppend bool) (*os.File, error)

OpenOrCreateFile opens specified file. Creates file and its path if they do not exist.

func OpenOrCreateFolder

func OpenOrCreateFolder(path string) error

OpenOrCreateFolder opens specified folder. Creates folder and its path if they do not exist.

func WriteToFile

func WriteToFile(path string, content []byte) (*os.File, error)

WriteToFile writes to a file. Creates file if it does not exist.

Types

This section is empty.

Jump to

Keyboard shortcuts

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