| [ Web Proxy ] |
| Viewing: https://pkg.go.dev/code.cloudfoundry.org/rep | [Back] [Original] |
This package is not in the latest version of its module.
Go to latest Published: Feb 27, 2024 License: Apache-2.0The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Modules with tagged versions give importers more predictable builds.
When a project reaches major version v1 it is considered stable.
const ( LifecycleTag = "lifecycle" ResultFileTag = "result-file" DomainTag = "domain" TaskLifecycle = "task" LRPLifecycle = "lrp" ProcessGuidTag = "process-guid" InstanceGuidTag = "instance-guid" ProcessIndexTag = "process-index" VolumeDriversTag = "volume-drivers" PlacementTagsTag = "placement-tags" )
const ( LayeringModeSingleLayer = "single-layer" LayeringModeTwoLayer = "two-layer" )
const ( StateRoute = "STATE" ContainerMetricsRoute = "ContainerMetrics" PerformRoute = "PERFORM" UpdateLRPInstanceRoute = "UpdateLRPInstance" UpdateLRPInstanceRoute_r0 = "UpdateLRPInstance_r0" StopLRPInstanceRoute = "StopLRPInstance" CancelTaskRoute = "CancelTask" SimResetRoute = "RESET" PingRoute = "Ping" EvacuateRoute = "Evacuate" )
var ( ErrContainerMissingTags = errors.New("container is missing tags") ErrInvalidProcessIndex = errors.New("container does not have a valid process index") )
var ErrPreloadedRootFSNotFound = errors.New("preloaded rootfs path not found")
ErrPreloadedRootFSNotFound is returned when the given hostname of the rootFS could not be resolved if the scheme is the PreloadedRootFSScheme or the PreloadedOCIRootFSScheme. This isn't the error for when the actual path on the system could not be found.
var ErrorIncompatibleRootfs = errors.New("rootfs not found")
var Routes = append(RoutesLocalhostOnly, RoutesNetworkAccessible...)
var RoutesLocalhostOnly = NewRoutes(false)
var RoutesNetworkAccessible = NewRoutes(true)
func ActualLRPKeyFromTags(tags executor.Tags) (*models.ActualLRPKey, error)
func ActualLRPNetInfoFromContainer(container executor.Container) (*models.ActualLRPNetInfo, error)
func ConvertCachedDependencies(modelDeps []*models.CachedDependency) []executor.CachedDependency
func ConvertCachedDependency(modelDep *models.CachedDependency) executor.CachedDependency
func ConvertPortMappings(containerPorts []uint32) []executor.PortMapping
func ConvertPreloadedRootFS(rootFS string, imageLayers []*models.ImageLayer, layeringMode string) (string, []*models.ImageLayer)
ConvertPreloadedRootFS takes in a rootFS URL and a list of image layers and in most cases just returns the same rootFS URL and list of image layers.
In the case where all of the following are true:
then the rootfs URL will be converted to have a `preloaded+layer` scheme and a query string that references the first image layer that matches all of those restrictions. This image layer will also be removed from the list.
type ArbitraryRootFSProvider struct{}
func (provider ArbitraryRootFSProvider) MarshalJSON() ([]byte, error)
func (ArbitraryRootFSProvider) Match(url.URL) bool
func (ArbitraryRootFSProvider) Type() RootFSProviderType
type CellState struct {
RepURL string `json:"rep_url"`
CellID string `json:"cell_id"`
CellIndex int `json:"cell_index"`
RootFSProviders RootFSProviders
AvailableResources Resources
TotalResources Resources
LRPs []LRP
Tasks []Task
StartingContainerCount int
Zone string
Evacuating bool
VolumeDrivers []string
PlacementTags []string
OptionalPlacementTags []string
ProxyMemoryAllocationMB int
}
func NewCellState( cellID string, cellIndex int, repURL string, root RootFSProviders, avail Resources, total Resources, lrps []LRP, tasks []Task, zone string, startingContainerCount int, isEvac bool, volumeDrivers []string, placementTags []string, optionalPlacementTags []string, proxyMemoryAllocation int, ) CellState
type Client interface {
State(logger lager.Logger) (CellState, error)
Perform(logger lager.Logger, work Work) (Work, error)
UpdateLRPInstance(logger lager.Logger, update LRPUpdate) error
StopLRPInstance(logger lager.Logger, key models.ActualLRPKey, instanceKey models.ActualLRPInstanceKey) error
CancelTask(logger lager.Logger, taskGuid string) error
SetStateClient(stateClient *http.Client)
StateClientTimeout() time.Duration
}
func NewClientFactory(httpClient, stateClient *http.Client, tlsConfig *TLSConfig) (ClientFactory, error)
type ContainerMetricsCollection struct {
CellID string `json:"cell_id"`
LRPs []LRPMetric `json:"lrps"`
Tasks []TaskMetric `json:"tasks"`
}
type ContainerMetricsProvider interface {
Metrics() map[string]*containermetrics.CachedContainerMetrics
}
type FixedSetRootFSProvider struct {
FixedSet StringSet
}
func NewFixedSetRootFSProvider(rootfses ...string) FixedSetRootFSProvider
func (provider FixedSetRootFSProvider) MarshalJSON() ([]byte, error)
func (provider FixedSetRootFSProvider) Match(rootfs url.URL) bool
func (FixedSetRootFSProvider) Type() RootFSProviderType
func (provider *FixedSetRootFSProvider) UnmarshalJSON(payload []byte) error
type InsufficientResourcesError struct {
Problems map[string]struct{}
}
func (i InsufficientResourcesError) Error() string
type LRP struct {
InstanceGUID string `json:"instance_guid"`
models.ActualLRPKey
PlacementConstraint
Resource
State string `json:"state"`
}
func NewLRP(instanceGUID string, key models.ActualLRPKey, res Resource, pc PlacementConstraint) LRP
type LRPMetric struct {
InstanceGUID string `json:"instance_guid"`
ProcessGUID string `json:"process_guid"`
Index int32 `json:"index"`
containermetrics.CachedContainerMetrics
}
type LRPUpdate struct {
InstanceGUID string `json:"instance_guid"`
models.ActualLRPKey
InternalRoutes internalroutes.InternalRoutes `json:"internal_routes"`
MetricTags map[string]string `json:"metric_tags"`
}
func NewLRPUpdate(instanceGUID string, key models.ActualLRPKey, internalRoutes internalroutes.InternalRoutes, metricTags map[string]string) LRPUpdate
func NewPlacementConstraint(rootFs string, placementTags, volumeDrivers []string) PlacementConstraint
func (p *PlacementConstraint) Valid() bool
type RootFSProvider interface {
Type() RootFSProviderType
Match(url.URL) bool
}
type RootFSProviderType string
const ( RootFSProviderTypeArbitrary RootFSProviderType = "arbitrary" RootFSProviderTypeFixedSet RootFSProviderType = "fixed_set" )
type RootFSProviders map[string]RootFSProvider
func (p RootFSProviders) Copy() RootFSProviders
func (p RootFSProviders) Match(rootFS url.URL) bool
func (providers *RootFSProviders) UnmarshalJSON(payload []byte) error
func (rrch RunRequestConversionHelper) NewRunRequestFromDesiredLRP( containerGuid string, desiredLRP *models.DesiredLRP, lrpKey *models.ActualLRPKey, lrpInstanceKey *models.ActualLRPInstanceKey, stackPathMap StackPathMap, layeringMode string, ) (executor.RunRequest, error)
func (rrch RunRequestConversionHelper) NewRunRequestFromTask(task *models.Task, stackPathMap StackPathMap, layeringMode string) (executor.RunRequest, error)
StackPathMap maps aliases to rootFS paths on the system.
func (m StackPathMap) PathForRootFS(rootFS string) (string, error)
PathForRootFS resolves the hostname portion of the RootFS URL to the actual path to the preloaded rootFS on the system according to the StackPathMap
type TLSConfig struct {
RequireTLS bool
CertFile, KeyFile, CaCertFile string
ClientCacheSize int // the tls client cache size, 0 means use golang default value
}
capture the behavior described in the comment of this story https://www.pivotaltracker.com/story/show/130664747/comments/152863773
type Task struct {
TaskGuid string
Domain string
PlacementConstraint
Resource
State models.Task_State `json:"state"`
Failed bool `json:"failed"`
}
type TaskMetric struct {
TaskGUID string `json:"task_guid"`
containermetrics.CachedContainerMetrics
}
| Path | Synopsis |
|---|---|
|
auctioncellrepfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
|
|
|
|
gocurl
command
|
|
|
rep
command
|
|
|
evacuation_context/fake_evacuation_context
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
| generator creates operations for container processing | |
|
fake_generator
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
|
internal/fake_internal
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
|
handlersfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
|
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
| Web Proxy Viewer | New URL | Original Page |