util

package
v0.0.0-...-677932a Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Converter

type Converter interface {
	ToSvg(dot []byte) ([]byte, error)
}
var Con Converter = &converter{exec: Exec}

type ExecuteOption

type ExecuteOption func(*exec.Cmd)

func WithArgs

func WithArgs(args ...string) ExecuteOption

func WithStdErr

func WithStdErr(w io.Writer) ExecuteOption

func WithStdIn

func WithStdIn(r io.Reader) ExecuteOption

func WithStdOut

func WithStdOut(w io.Writer) ExecuteOption

type Executor

type Executor interface {
	Execute(command string, opts ...ExecuteOption) ([]byte, error)
}
var Exec Executor = &executor{}

type FileReadWriter

type FileReadWriter interface {
	WriteFile(path string, data []byte) error
	ReadFile(path string) ([]byte, error)
	Create(path string) (io.Writer, error)
	Mkdir(folderPath string) error
	Exists(path string) bool
	WriteYamlStruct(path string, data interface{}) error
	ReadYamlStruct(path string, data interface{}) error
}

FileReadWriter is an interface for file operations

var File FileReadWriter = &file{filePermission: filePermission, directoryPermission: directoryPermission}

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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