external

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: BSD-3-Clause Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotKubernetesPool = errors.New("not a kubernetes pool")
	ErrClusterNotFound   = errors.New("cluster not found")
)

Functions

func MetricsRoundTripper

func MetricsRoundTripper(next http.RoundTripper) http.RoundTripper

Types

type BaseHTTPClient

type BaseHTTPClient struct {
	sync.RWMutex

	Timeout     time.Duration
	URL         string
	User        string
	Password    string
	Token       string
	OAuthURL    string
	OAuthId     string
	OAuthSecret string
	Logger      logrus.FieldLogger
	// contains filtered or unexported fields
}

func (*BaseHTTPClient) DoRequestData

func (e *BaseHTTPClient) DoRequestData(method, path string, body io.Reader, headers map[string]string) ([]byte, error)

func (*BaseHTTPClient) DoRequestDataCtx

func (e *BaseHTTPClient) DoRequestDataCtx(ctx context.Context, method, path string, body io.Reader, headers map[string]string) ([]byte, error)

func (*BaseHTTPClient) GetClient

func (e *BaseHTTPClient) GetClient() (*http.Client, error)

type HTTPError

type HTTPError struct {
	StatusCode int
	Body       string
	Headers    http.Header
}

func (*HTTPError) Error

func (e *HTTPError) Error() string

type TsuruClient

type TsuruClient interface {
	PoolCluster(tsuruPool pool.Pool) (*provTypes.Cluster, error)
	Cluster(clusterName string) (*provTypes.Cluster, error)
	JobInfo(jobName string) (*jobTypes.Job, error)
	AppInfo(appName string) (*app.App, error)
	PoolInfo(poolName string) (*pool.Pool, error)
	Clusters() ([]provTypes.Cluster, error)
}

func NewTsuruClient

func NewTsuruClient() TsuruClient

Jump to

Keyboard shortcuts

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