Documentation ¶
Index ¶
- type ErrorStruct
- type NPMErrorResponse
- type OSContext
- type OSContextImpl
- func (os *OSContextImpl) GetHomeDir() (string, error)
- func (os *OSContextImpl) RunCommand(name string, args ...string) (bytes.Buffer, error)
- func (os *OSContextImpl) RunCommandBytes(name string, args ...string) ([]byte, error)
- func (os *OSContextImpl) RunCommandString(name string, args ...string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorStruct ¶
type ErrorStruct struct { Code string `json:"code"` Summary string `json:"summary"` Detail string `json:"detail"` }
ErrorStruct defines contents of NPMErrorResponse.
type NPMErrorResponse ¶
type NPMErrorResponse struct {
ErrorBlock ErrorStruct `json:"error"`
}
NPMErrorResponse is the JSON response for an npm command when it errors.
type OSContext ¶
type OSContext interface { RunCommand(name string, args ...string) (bytes.Buffer, error) RunCommandBytes(name string, args ...string) ([]byte, error) RunCommandString(name string, args ...string) (string, error) GetHomeDir() (string, error) }
OSContext interface for running CLI commands.
func NewOSContext ¶
func NewOSContext() OSContext
NewOSContext creates an instance of OSContextImpl.
type OSContextImpl ¶
type OSContextImpl struct { }
OSContextImpl an implementation for OSContext using os/exec.
func (*OSContextImpl) GetHomeDir ¶
func (os *OSContextImpl) GetHomeDir() (string, error)
GetHomeDir fetches current user and gets its home directory.
func (*OSContextImpl) RunCommand ¶
RunCommand used instead of exec.Command.
func (*OSContextImpl) RunCommandBytes ¶
func (os *OSContextImpl) RunCommandBytes(name string, args ...string) ([]byte, error)
RunCommandBytes used instead of exec.Command.
func (*OSContextImpl) RunCommandString ¶
func (os *OSContextImpl) RunCommandString(name string, args ...string) (string, error)
RunCommandString used instead of exec.Command.
Click to show internal directories.
Click to hide internal directories.