bifrost

package
v0.0.0-...-db62745 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIConverter

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

func NewAPIConverter

func NewAPIConverter(logger lager.Logger) *APIConverter

func (*APIConverter) ConvertLRP

func (c *APIConverter) ConvertLRP(request cf.DesireLRPRequest) (api.LRP, error)

func (*APIConverter) ConvertTask

func (c *APIConverter) ConvertTask(taskGUID string, request cf.TaskRequest) (api.Task, error)

type DockerStaging

type DockerStaging struct {
	Logger               lager.Logger
	ImageMetadataFetcher ImageMetadataFetcher
	ImageRefParser       ImageRefParser
	StagingCompleter     StagingCompleter
}

func (DockerStaging) CompleteStaging

func (s DockerStaging) CompleteStaging(ctx context.Context, taskCompletedRequest cf.StagingCompletedRequest) error

func (DockerStaging) TransferStaging

func (s DockerStaging) TransferStaging(ctx context.Context, stagingGUID string, request cf.StagingRequest) error

type ImageMetadataFetcher

type ImageMetadataFetcher func(string, types.SystemContext) (*v1.ImageConfig, error)

func (ImageMetadataFetcher) Fetch

func (f ImageMetadataFetcher) Fetch(dockerRef string, sysCtx types.SystemContext) (*v1.ImageConfig, error)

type ImageRefParser

type ImageRefParser func(string) (string, error)

func (ImageRefParser) Parse

func (f ImageRefParser) Parse(img string) (string, error)

type JSONClient

type JSONClient interface {
	Post(ctx context.Context, url string, data interface{}) error
}

type LRP

type LRP struct {
	Converter  LRPConverter
	LRPClient  LRPClient
	Namespacer LRPNamespacer
}

func (*LRP) GetApp

func (l *LRP) GetApp(ctx context.Context, identifier api.LRPIdentifier) (cf.DesiredLRP, error)

func (*LRP) GetInstances

func (l *LRP) GetInstances(ctx context.Context, identifier api.LRPIdentifier) ([]*cf.Instance, error)

func (*LRP) List

func (l *LRP) List(ctx context.Context) ([]cf.DesiredLRPSchedulingInfo, error)

func (*LRP) Stop

func (l *LRP) Stop(ctx context.Context, identifier api.LRPIdentifier) error

func (*LRP) StopInstance

func (l *LRP) StopInstance(ctx context.Context, identifier api.LRPIdentifier, index uint) error

func (*LRP) Transfer

func (l *LRP) Transfer(ctx context.Context, request cf.DesireLRPRequest) error

func (*LRP) Update

func (l *LRP) Update(ctx context.Context, request cf.UpdateDesiredLRPRequest) error

type LRPClient

type LRPClient interface {
	Desire(ctx context.Context, namespace string, lrp *api.LRP, opts ...shared.Option) error
	List(ctx context.Context) ([]*api.LRP, error)
	Get(ctx context.Context, identifier api.LRPIdentifier) (*api.LRP, error)
	GetInstances(ctx context.Context, identifier api.LRPIdentifier) ([]*api.Instance, error)
	Update(ctx context.Context, lrp *api.LRP) error
	Stop(ctx context.Context, identifier api.LRPIdentifier) error
	StopInstance(ctx context.Context, identifier api.LRPIdentifier, index uint) error
}

type LRPConverter

type LRPConverter interface {
	ConvertLRP(request cf.DesireLRPRequest) (api.LRP, error)
}

type LRPNamespacer

type LRPNamespacer interface {
	GetNamespace(requestedNamespace string) string
}

type LifecycleMetadata

type LifecycleMetadata struct {
	DockerImage string `json:"docker_image"`
}

type Namespacer

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

func NewNamespacer

func NewNamespacer(defaultNs string) Namespacer

func (Namespacer) GetNamespace

func (n Namespacer) GetNamespace(ns string) string

type ProcessTypes

type ProcessTypes struct {
	Web string `json:"web"`
}

type StagingCompleter

type StagingCompleter interface {
	CompleteStaging(ctx context.Context, req cf.StagingCompletedRequest) error
}

type StagingResult

type StagingResult struct {
	LifecycleType     string            `json:"lifecycle_type"`
	LifecycleMetadata LifecycleMetadata `json:"lifecycle_metadata"`
	ProcessTypes      ProcessTypes      `json:"process_types"`
	ExecutionMetadata string            `json:"execution_metadata"`
}

type Task

type Task struct {
	Namespacer TaskNamespacer
	Converter  TaskConverter
	TaskClient TaskClient
	JSONClient JSONClient
}

func (*Task) CancelTask

func (t *Task) CancelTask(ctx context.Context, taskGUID string) error

func (*Task) GetTask

func (t *Task) GetTask(ctx context.Context, taskGUID string) (cf.TaskResponse, error)

func (*Task) ListTasks

func (t *Task) ListTasks(ctx context.Context) (cf.TasksResponse, error)

func (*Task) TransferTask

func (t *Task) TransferTask(ctx context.Context, taskGUID string, taskRequest cf.TaskRequest) error

type TaskClient

type TaskClient interface {
	Desire(ctx context.Context, namespace string, task *api.Task, opts ...shared.Option) error
	Get(ctx context.Context, guid string) (*api.Task, error)
	List(ctx context.Context) ([]*api.Task, error)
	Delete(ctx context.Context, guid string) (string, error)
}

type TaskConverter

type TaskConverter interface {
	ConvertTask(taskGUID string, request cf.TaskRequest) (api.Task, error)
}

type TaskNamespacer

type TaskNamespacer interface {
	GetNamespace(requestedNamespace string) string
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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