tsuructx

package
v2.0.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DescriptorReader

type DescriptorReader interface {
	Read(p []byte) (n int, err error)
	Fd() uintptr
}

type FakeStdin

type FakeStdin struct {
	Reader io.Reader
}

func (*FakeStdin) Fd

func (f *FakeStdin) Fd() uintptr

func (*FakeStdin) Read

func (f *FakeStdin) Read(p []byte) (n int, err error)

type TsuruClientHTTPTransport

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

func (*TsuruClientHTTPTransport) RoundTrip

func (t *TsuruClientHTTPTransport) RoundTrip(req *http.Request) (*http.Response, error)

type TsuruContext

type TsuruContext struct {
	TsuruContextOpts
	TokenSetFromFS bool
}

func TsuruContextWithConfig

func TsuruContextWithConfig(opts *TsuruContextOpts) *TsuruContext

TsuruContextWithConfig returns a new TsuruContext with the given configuration.

func (*TsuruContext) Client

func (c *TsuruContext) Client() *tsuru.APIClient

Client is the tsuru client implementated by go-tsuruclient

func (*TsuruContext) Config

func (c *TsuruContext) Config() *tsuru.Configuration

Config is the tsuru client configuration

func (*TsuruContext) DefaultHeaders

func (tc *TsuruContext) DefaultHeaders() http.Header

func (*TsuruContext) NewRequest

func (tc *TsuruContext) NewRequest(method string, url string, body io.Reader) (*http.Request, error)

NewRequest creates a new http.Request with the correct base path.

func (*TsuruContext) RawHTTPClient

func (c *TsuruContext) RawHTTPClient() *http.Client

RawHTTPClient is the raw http client for REST calls

func (*TsuruContext) SetTargetURL

func (tc *TsuruContext) SetTargetURL(value string)

func (*TsuruContext) SetToken

func (tc *TsuruContext) SetToken(value string)

func (*TsuruContext) SetVerbosity

func (tc *TsuruContext) SetVerbosity(value int)

func (*TsuruContext) TargetURL

func (tc *TsuruContext) TargetURL() string

func (*TsuruContext) Token

func (tc *TsuruContext) Token() string

func (*TsuruContext) Verbosity

func (tc *TsuruContext) Verbosity() int

type TsuruContextOpts

type TsuruContextOpts struct {
	// Verbosity is the verbosity level for tsuru client. Should be 1 ou 2
	// InsecureSkipVerify will skip TLS verification (not applied to websockets)
	InsecureSkipVerify bool
	// LocalTZ is the local timezone
	LocalTZ *time.Location
	// AuthScheme is the protocol used for tsuru login. Overriden with TSURU_AUTH_SCHEME
	AuthScheme string
	// Executor is an instance of an interface for exec.Command()
	Executor exec.Executor
	// Fs is the filesystem used by the client
	Fs afero.Fs
	// Viper is an instance of the viper.Viper configuration
	Viper *viper.Viper

	UserAgent string

	Stdout io.Writer
	Stderr io.Writer
	Stdin  DescriptorReader
}

func DefaultTestingTsuruContextOptions

func DefaultTestingTsuruContextOptions(vip *viper.Viper) *TsuruContextOpts

Jump to

Keyboard shortcuts

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