cli

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

README

NOTICE

This package was copied from the bosh-cli here and modified to remove dependencies on errors and logger

It was chosen to copy this code in order to configure the socks5 proxy settings for tunneling without requiring the user of our software to set the BOSH_ALL_PROXY environment variable.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientRequest

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

func NewClientRequest

func NewClientRequest(
	endpoint string,
	httpClient *httpclient.DefaultHTTPClient,
	fileReporter director.FileReporter,
) ClientRequest

func (ClientRequest) Delete

func (r ClientRequest) Delete(path string, response interface{}) error

func (ClientRequest) Get

func (r ClientRequest) Get(path string, response interface{}) error

func (ClientRequest) Post

func (r ClientRequest) Post(path string, payload []byte, f func(*http.Request), response interface{}) error

func (ClientRequest) Put

func (r ClientRequest) Put(path string, payload []byte, f func(*http.Request), response interface{}) error

func (ClientRequest) RawDelete

func (r ClientRequest) RawDelete(path string) ([]byte, *http.Response, error)

RawDelete follows redirects via GET unlike generic HTTP clients

func (ClientRequest) RawGet

func (r ClientRequest) RawGet(path string, out io.Writer, f func(*http.Request)) ([]byte, *http.Response, error)

func (ClientRequest) RawPost

func (r ClientRequest) RawPost(path string, payload []byte, f func(*http.Request)) ([]byte, *http.Response, error)

RawPost follows redirects via GET unlike generic HTTP clients

func (ClientRequest) RawPut

func (r ClientRequest) RawPut(path string, payload []byte, f func(*http.Request)) ([]byte, *http.Response, error)

RawPut follows redirects via GET unlike generic HTTP clients

func (ClientRequest) WithContext

func (r ClientRequest) WithContext(contextId string) ClientRequest

type Deployment

type Deployment interface {
	VMInfos() ([]director.VMInfo, error)
}

type DeploymentImpl

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

func (DeploymentImpl) VMInfos

func (d DeploymentImpl) VMInfos() ([]director.VMInfo, error)

type Director

type Director interface {
	IsAuthenticated() (bool, error)
	Info() (director.Info, error)
	ListDeployments() ([]director.DeploymentResp, error)
	FindDeployment(name string) (Deployment, error)
}

type DirectorClient

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

func NewClient

func NewClient(
	endpoint string,
	httpClient *httpclient.DefaultHTTPClient,
	taskReporter director.TaskReporter,
	fileReporter director.FileReporter,
) DirectorClient

func (DirectorClient) DeploymentVMInfos

func (c DirectorClient) DeploymentVMInfos(deploymentName string) ([]director.VMInfo, error)

func (DirectorClient) DeploymentsWithoutConfigs

func (c DirectorClient) DeploymentsWithoutConfigs() ([]director.DeploymentResp, error)

func (DirectorClient) Info

func (c DirectorClient) Info() (director.InfoResp, error)

func (DirectorClient) WithContext

func (c DirectorClient) WithContext(contextId string) DirectorClient

type DirectorImpl

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

func (DirectorImpl) FindDeployment

func (d DirectorImpl) FindDeployment(name string) (Deployment, error)

func (DirectorImpl) Info

func (d DirectorImpl) Info() (director.Info, error)

func (DirectorImpl) IsAuthenticated

func (d DirectorImpl) IsAuthenticated() (bool, error)

func (DirectorImpl) ListDeployments

func (d DirectorImpl) ListDeployments() ([]director.DeploymentResp, error)

type Factory

type Factory struct{}

func NewFactory

func NewFactory() Factory

func (Factory) New

func (f Factory) New(allProxy string, factoryConfig director.FactoryConfig, taskReporter director.TaskReporter, fileReporter director.FileReporter) (Director, error)

type ShouldTrackDownload

type ShouldTrackDownload interface {
	ShouldTrackDownload() bool
}

type TaskClientRequest

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

func NewTaskClientRequest

func NewTaskClientRequest(
	clientRequest ClientRequest,
	taskReporter director.TaskReporter,
	taskCheckStepDuration time.Duration,
) TaskClientRequest

func (TaskClientRequest) DeleteResult

func (r TaskClientRequest) DeleteResult(path string) ([]byte, error)

func (TaskClientRequest) GetResult

func (r TaskClientRequest) GetResult(path string) (int, []byte, error)

func (TaskClientRequest) PostResult

func (r TaskClientRequest) PostResult(path string, payload []byte, f func(*http.Request)) ([]byte, error)

func (TaskClientRequest) PutResult

func (r TaskClientRequest) PutResult(path string, payload []byte, f func(*http.Request)) ([]byte, error)

func (TaskClientRequest) WaitForCompletion

func (r TaskClientRequest) WaitForCompletion(id int, type_ string, taskReporter director.TaskReporter) error

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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