utils

package
v0.0.0-...-0585133 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: GPL-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateFileInfo

func CalculateFileInfo(path string) (int, int64, error)

CalculateFileInfo calculates the total size and number of files in the directory

func CopyDir

func CopyDir(src, dst string) error

CopyDir copies a directory recursively from src to dst.

func CopyFile

func CopyFile(src, dst string) error

CopyFile copies a file from src to dst.

func CreateLocalBranchIfNeeded

func CreateLocalBranchIfNeeded(memoryStorage storage.Storer, abstractFilesystemAtRepoPath billy.Filesystem, branchName string) error

func DockerContainerCreate

func DockerContainerCreate()

DockerContainerCreate starts a docker dockerContainer

func DockerImageList

func DockerImageList()

DockerImageList list docker image(s)

func DockerImagePull

func DockerImagePull(imageName string) error

DockerImagePull Pulls a Docker image for a GovCMS service and prints the output in a nicer format.

func ExecuteCommand

func ExecuteCommand(cmd *exec.Cmd)

ExecuteCommand starts a command, captures its output, and waits for it to finish

func GetContainerIP

func GetContainerIP(containerID string) (string, error)

GetContainerIP returns the getContainerIP address of the dockerContainer.

func GetContainerIdByName

func GetContainerIdByName(name string) (string, error)

func GetContainerIpByName

func GetContainerIpByName(name string) string

func GetOperatingSystem

func GetOperatingSystem() string

Returns the name of the current operating system

func GetPullRequest

func GetPullRequest(memoryStorage storage.Storer, abstractFilesystemAtRepoPath billy.Filesystem, prNumber int) error

func NewBillyFromAfero

func NewBillyFromAfero(fs afero.Fs, basePath string) billy.Filesystem

NewBillyFromAfero converts an Afero filesystem to a Billy filesystem

func OpenBrowser

func OpenBrowser(url string) error

Opens the default web browser with the specified URL

func PrintOutput

func PrintOutput(reader io.Reader)

PrintOutput reads from a reader and prints the output

Types

type AdapterFs

type AdapterFs struct {
	// contains filtered or unexported fields
}

AdapterFs holds an afero Fs interface for adaptation to billy.Filesystem

func (*AdapterFs) Capabilities

func (fs *AdapterFs) Capabilities() billy.Capability

Capabilities implements the Capable interface.

func (*AdapterFs) Create

func (fs *AdapterFs) Create(filename string) (billy.File, error)

func (*AdapterFs) Join

func (fs *AdapterFs) Join(elem ...string) string

func (*AdapterFs) Lstat

func (fs *AdapterFs) Lstat(filename string) (os.FileInfo, error)

func (*AdapterFs) MkdirAll

func (fs *AdapterFs) MkdirAll(path string, perm os.FileMode) error

func (*AdapterFs) Open

func (fs *AdapterFs) Open(filename string) (billy.File, error)

func (*AdapterFs) OpenFile

func (fs *AdapterFs) OpenFile(filename string, flag int, perm os.FileMode) (billy.File, error)

func (*AdapterFs) ReadDir

func (fs *AdapterFs) ReadDir(path string) ([]os.FileInfo, error)
func (fs *AdapterFs) Readlink(link string) (string, error)

func (*AdapterFs) Remove

func (fs *AdapterFs) Remove(filename string) error

func (*AdapterFs) RemoveAll

func (fs *AdapterFs) RemoveAll(path string) error

func (*AdapterFs) Rename

func (fs *AdapterFs) Rename(from, to string) error

func (*AdapterFs) Stat

func (fs *AdapterFs) Stat(filename string) (os.FileInfo, error)
func (fs *AdapterFs) Symlink(target, link string) error

func (*AdapterFs) TempFile

func (fs *AdapterFs) TempFile(dir, prefix string) (billy.File, error)

Jump to

Keyboard shortcuts

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