factory

package
v0.0.0-...-a44c915 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseURL

func BaseURL(f *Factory) func() string

Types

type Factory

type Factory struct {
	// HTTPClient is the underlying HTTP client used in APIClient and CustomHTTPClient
	HTTPClient func() (*http.Client, error)
	// CustomHTTPClient includes a custom HTTP.Client that includes the default
	// headers to integrate with a Controller
	// the custom HTTP client includes the default transport layer to import TLS certificate
	// and applies Accept, Authorization, and User-Agent headers to all requests
	CustomHTTPClient func() (*http.Client, error)
	// HTTPTransport is used by all HTTP Clients to import custom TLS certificate and set timeout values
	HTTPTransport func() (*http.Transport, error)
	// APIClient is the generated api client based on the openapi-generator https://github.com/appgate/sdp-api-client-go
	APIClient      func(c *configuration.Config) (*openapi.APIClient, error)
	Appliance      func(c *configuration.Config) (*appliance.Appliance, error)
	Token          func(c *configuration.Config) (*token.Token, error)
	ServiceUsers   func(c *configuration.Config) (*serviceusers.ServiceUsersAPI, error)
	DockerRegistry func(s string) (*url.URL, error)
	BaseURL        func() string

	Config      *configuration.Config
	IOOutWriter io.Writer
	Stdin       io.ReadCloser
	StdErr      io.Writer
	SpinnerOut  io.Writer
	// contains filtered or unexported fields
}

func New

func New(appVersion string, config *configuration.Config) *Factory

func (*Factory) CanPrompt

func (f *Factory) CanPrompt() bool

func (*Factory) DisablePrompt

func (f *Factory) DisablePrompt(v bool)

func (*Factory) GetDockerRegistry

func (f *Factory) GetDockerRegistry(s string) (*url.URL, error)

GetDockerRegistry parses and returns a normalized URL for the docker registry to be used The URL needs to be valid and the following priority will be evaluated 1. Argument 's' 2. If the 'SDPCTL_DOCKER_REGISTRY' environment variable is set 3. The default registry which is set during build time

func (*Factory) GetSpinnerOutput

func (f *Factory) GetSpinnerOutput() func() io.Writer

func (*Factory) SetSpinnerOutput

func (f *Factory) SetSpinnerOutput(o io.Writer)

Jump to

Keyboard shortcuts

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