backend

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectArchLinux

func DetectArchLinux(fs afero.Fs) bool

func DetectDarwin

func DetectDarwin(execIF exec.Interface) bool

Types

type ArchLinuxBackend

type ArchLinuxBackend struct {
	Backend
	*BaseBackend
	Exec exec.Interface
}

func (*ArchLinuxBackend) CheckInstall

func (b *ArchLinuxBackend) CheckInstall(ctx context.Context, name string) bool

func (*ArchLinuxBackend) Command

func (b *ArchLinuxBackend) Command(ctx context.Context, p *CommandParams) error

func (*ArchLinuxBackend) FileCopy

func (b *ArchLinuxBackend) FileCopy(ctx context.Context, p *FileCopyParams) error

func (*ArchLinuxBackend) FileMove

func (b *ArchLinuxBackend) FileMove(ctx context.Context, p *FileMoveParams) error

func (*ArchLinuxBackend) HTTPRequest

func (b *ArchLinuxBackend) HTTPRequest(ctx context.Context, p *HTTPRequestParams) error

func (*ArchLinuxBackend) Install

func (b *ArchLinuxBackend) Install(ctx context.Context, p *InstallParams) error
func (b *ArchLinuxBackend) Symlink(ctx context.Context, p *SymlinkParams) error

func (*ArchLinuxBackend) Uninstall

func (b *ArchLinuxBackend) Uninstall(ctx context.Context, name string) error

type Backend

type Backend interface {
	CheckInstall(ctx context.Context, name string) bool
	Install(ctx context.Context, p *InstallParams) error
	Uninstall(ctx context.Context, name string) error
	FileCopy(ctx context.Context, p *FileCopyParams) error
	FileMove(ctx context.Context, p *FileMoveParams) error
	Symlink(ctx context.Context, p *SymlinkParams) error
	HTTPRequest(ctx context.Context, p *HTTPRequestParams) error
	Command(ctx context.Context, p *CommandParams) error
}

func New

func New(execIF exec.Interface, fs afero.Fs) Backend

func NewDryRunBackend

func NewDryRunBackend(execIF exec.Interface, fs afero.Fs) Backend

type BaseBackend

type BaseBackend struct {
	Exec   exec.Interface
	Fs     afero.Fs
	Client *http.Client
}

func (*BaseBackend) CheckInstall

func (b *BaseBackend) CheckInstall(ctx context.Context, name string) bool

func (*BaseBackend) Command

func (b *BaseBackend) Command(ctx context.Context, p *CommandParams) error

func (*BaseBackend) FileCopy

func (b *BaseBackend) FileCopy(ctx context.Context, p *FileCopyParams) error

func (*BaseBackend) FileMove

func (b *BaseBackend) FileMove(ctx context.Context, p *FileMoveParams) error

func (*BaseBackend) HTTPRequest

func (b *BaseBackend) HTTPRequest(ctx context.Context, p *HTTPRequestParams) error

func (*BaseBackend) Install

func (b *BaseBackend) Install(ctx context.Context, p *InstallParams) error
func (b *BaseBackend) Symlink(ctx context.Context, p *SymlinkParams) error

func (*BaseBackend) Uninstall

func (b *BaseBackend) Uninstall(ctx context.Context, name string) error

type CommandParams

type CommandParams struct {
	CmdName string
	CmdArgs []string
	Cwd     string
	User    string
}

type DarwinBackend

type DarwinBackend struct {
	Backend
	*BaseBackend
	Exec exec.Interface
	Fs   afero.Fs
}

func (*DarwinBackend) CheckInstall

func (b *DarwinBackend) CheckInstall(ctx context.Context, name string) bool

func (*DarwinBackend) Command

func (b *DarwinBackend) Command(ctx context.Context, p *CommandParams) error

func (*DarwinBackend) FileCopy

func (b *DarwinBackend) FileCopy(ctx context.Context, p *FileCopyParams) error

func (*DarwinBackend) FileMove

func (b *DarwinBackend) FileMove(ctx context.Context, p *FileMoveParams) error

func (*DarwinBackend) HTTPRequest

func (b *DarwinBackend) HTTPRequest(ctx context.Context, p *HTTPRequestParams) error

func (*DarwinBackend) Install

func (b *DarwinBackend) Install(ctx context.Context, p *InstallParams) error
func (b *DarwinBackend) Symlink(ctx context.Context, p *SymlinkParams) error

func (*DarwinBackend) Uninstall

func (b *DarwinBackend) Uninstall(ctx context.Context, name string) error

type DryRunBackend

type DryRunBackend struct {
	Exec exec.Interface
	Fs   afero.Fs
}

func (*DryRunBackend) CheckInstall

func (b *DryRunBackend) CheckInstall(ctx context.Context, name string) bool

func (*DryRunBackend) Command

func (b *DryRunBackend) Command(ctx context.Context, p *CommandParams) error

func (*DryRunBackend) FileCopy

func (b *DryRunBackend) FileCopy(ctx context.Context, p *FileCopyParams) error

func (*DryRunBackend) FileMove

func (b *DryRunBackend) FileMove(ctx context.Context, p *FileMoveParams) error

func (*DryRunBackend) HTTPRequest

func (b *DryRunBackend) HTTPRequest(ctx context.Context, p *HTTPRequestParams) error

func (*DryRunBackend) Install

func (b *DryRunBackend) Install(ctx context.Context, p *InstallParams) error
func (b *DryRunBackend) Symlink(ctx context.Context, p *SymlinkParams) error

func (*DryRunBackend) Uninstall

func (b *DryRunBackend) Uninstall(ctx context.Context, name string) error

type FileCopyParams

type FileCopyParams struct {
	Src        string
	Dest       string
	Permission os.FileMode
}

type FileMoveParams

type FileMoveParams struct {
	Src  string
	Dest string
}

type HTTPRequestParams

type HTTPRequestParams struct {
	URL  string
	Path string
}

type InstallParams

type InstallParams struct {
	Name   string
	Option string
}

type OS

type OS int
const (
	Unknown OS = iota + 1
	Darwin
	Arch
)

func DetectOS

func DetectOS(execIF exec.Interface, fs afero.Fs) OS

type SymlinkParams

type SymlinkParams struct {
	Src  string
	Dest string
	User string
}

Directories

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

Jump to

Keyboard shortcuts

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