cloudfoundry

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2020 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultWorkDir = ""

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	Name            string            `json:"name,omitempty"`
	Docker          *DockerConfig     `yaml:"docker,omitempty"`
	Metadata        *Metadata         `yaml:"metadata,omitempty"`
	Memory          string            `yaml:"memory,omitempty"`
	DiskQuota       string            `yaml:"disk_quota,omitempty"`
	Path            string            `yaml:"path,omitempty"`
	Buildpacks      []string          `yaml:"buildpacks,omitempty"`
	Routes          []Route           `yaml:"routes,omitempty"`
	NoRoute         bool              `yaml:"no-route,omitempty"`
	HealthCheckType string            `yaml:"health-check-type,omitempty"`
	Env             map[string]string `yaml:"env,omitempty"`
	Instances       int               `yaml:"intances,omitempty"`
	Services        []string          `yaml:"services,omitempty"`
	Sidecars        []Sidecar         `yaml:"sidecars,omitempty"`
	Command         string            `yaml:"command,omitempty"`
}

type ApplicationReconciler

type ApplicationReconciler struct {
	OwnerLabel string
	Session    *Session
	Log        *logrus.Logger
}

func (*ApplicationReconciler) Reconcile

func (r *ApplicationReconciler) Reconcile(ctx context.Context, manifest Manifest) error

type CLIClient

type CLIClient struct {
	sync.Mutex
	Endpoint    string
	Username    string
	Password    string
	TargetOrg   string
	TargetSpace string
}

func (*CLIClient) AddNetworkPolicy

func (cli *CLIClient) AddNetworkPolicy(srcAppName, dstAppName, port string) error

cf add-network-policy PUBLIC_APPNAME --destination-app PRIVATE_APPNAME --protocol tcp --port 8080

func (*CLIClient) Authenticate

func (cli *CLIClient) Authenticate() error

func (*CLIClient) Push

func (cli *CLIClient) Push(manifest Manifest) error

Push shells out to the cf cli to perform "cf push" Ideally this wouldn't exist, but the full features of push are split over ccv2/ccv3 apis and custom logic in the cli at the point of writing this and reimplementing it didn't look fun

type Config

type Config struct {
	Endpoint          string
	Username          string
	Password          string
	Token             string
	SSOPasscode       string
	CFClientID        string
	CFClientSecret    string
	UaaClientID       string
	UaaClientSecret   string
	SkipSslValidation bool
	OrgName           string
	SpaceName         string
}

Config -

type DockerConfig

type DockerConfig struct {
	Image string `yaml:"image"`
}

type Manifest

type Manifest struct {
	Applications []Application `json:"applications"`
	Services     []string      `json:"services,omitempty"`
}

type Metadata

type Metadata struct {
	Labels map[string]string `yaml:"labels,omitempty"`
}

type RetryRequest

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

RetryRequest is a wrapper that retries failed requests if they contain a 5XX status code. copy of wrapper retry request in cli but remove the necessary of have a readseeker body (annoying for sending in fullstream)

func NewRetryRequest

func NewRetryRequest(maxRetries int) *RetryRequest

NewRetryRequest returns a pointer to a RetryRequest wrapper.

func (*RetryRequest) Make

func (retry *RetryRequest) Make(request *cloudcontroller.Request, passedResponse *cloudcontroller.Response) error

Make retries the request if it comes back with a 5XX status code.

func (*RetryRequest) Wrap

func (retry *RetryRequest) Wrap(innerconnection cloudcontroller.Connection) cloudcontroller.Connection

Wrap sets the connection in the RetryRequest and returns itself.

type Route

type Route struct {
	Route string `json:"route"`
}

type Service

type Service struct {
	ServiceName  string
	PlanName     string
	InstanceName string
}

type ServiceReconciler

type ServiceReconciler struct {
	OwnerLabel string
	Session    *Session
	Log        *logrus.Logger
	SpaceGUID  string
}

func (*ServiceReconciler) Reconcile

func (r *ServiceReconciler) Reconcile(ctx context.Context, service Service) error

type Session

type Session struct {
	ClientV3      *ccv3.Client
	ConfigV3      *configv3.Config
	ClientV2      *ccv2.Client
	ClientUAA     *uaa.Client
	ClientRouting *router.Client
	CLIClient     *CLIClient
	ApiEndpoint   string
}

Session - wraps the available clients from CF cli

func NewSession

func NewSession(c Config) (s *Session, err error)

NewSession -

func (*Session) AccessToken

func (s *Session) AccessToken() string

func (*Session) BinaryName

func (s *Session) BinaryName() string

func (*Session) CurrentUserName

func (s *Session) CurrentUserName() (string, error)

func (*Session) HasTargetedOrganization

func (s *Session) HasTargetedOrganization() bool

func (*Session) HasTargetedSpace

func (s *Session) HasTargetedSpace() bool

func (*Session) RefreshToken

func (s *Session) RefreshToken() string

func (*Session) TargetedOrganization

func (s *Session) TargetedOrganization() configv3.Organization

func (*Session) TargetedOrganizationName

func (s *Session) TargetedOrganizationName() string

func (*Session) TargetedSpace

func (s *Session) TargetedSpace() configv3.Space

func (*Session) Verbose

func (s *Session) Verbose() (bool, []string)

type Sidecar

type Sidecar struct {
	Name         string   `yaml:"name"`
	ProcessTypes []string `yaml:"process_types"`
	Command      string   `yaml:"command"`
}

Jump to

Keyboard shortcuts

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