filepath

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

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

Go to latest
Published: May 13, 2021 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirectoryGetter

type DirectoryGetter interface {
	CurrentDirectory() (string, error)
	GetOS() string
}

DirectoryGetter wraps a few operating sytem specific methods.

type ExeDirGetter

type ExeDirGetter struct{}

ExeDirGetter implements the DirectoryGetter interface.

func (*ExeDirGetter) CurrentDirectory

func (e *ExeDirGetter) CurrentDirectory() (string, error)

CurrentDirectory returns the absolute full directory path of the currently running executable.

func (*ExeDirGetter) GetOS

func (e *ExeDirGetter) GetOS() string

Get OS returns the current operating system as a string. There should be three: "linux", "darwin", and "windows".

type FilepathBuilder

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

FilepathBuilder encapsulates the data and functionality to build the full versioned kubectl filepath from the server version.

func NewFilepathBuilder

func NewFilepathBuilder(dirGetter DirectoryGetter, filestat func(string) (os.FileInfo, error)) *FilepathBuilder

NewFilepathBuilder encapsulates information necessary to build the full file path of the versioned kubectl binary to execute.

func (*FilepathBuilder) ValidateFilepath

func (c *FilepathBuilder) ValidateFilepath(filepath string) error

func (*FilepathBuilder) VersionedFilePath

func (c *FilepathBuilder) VersionedFilePath(version version.Info) (string, error)

VersionedFilePath returns the full absolute file path to the versioned kubectl binary to dispatch to. On error, empty string is returned.

Jump to

Keyboard shortcuts

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