compose

package
v0.0.0-...-90e0edc Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2025 License: MIT Imports: 39 Imported by: 2

Documentation

Index

Constants

View Source
const (
	MiB                         = 1024 * 1024
	ContextFileLimit            = 100
	ContextSizeSoftLimit        = 10 * MiB
	DefaultContextSizeHardLimit = 100 * MiB
)
View Source
const Mode_HOST = "host"
View Source
const Mode_INGRESS = "ingress"
View Source
const Protocol_TCP = "tcp"
View Source
const Protocol_UDP = "udp"
View Source
const RAILPACK = "*Railpack"

Variables

View Source
var (
	ContextSizeHardLimit = parseContextLimit(os.Getenv("DEFANG_BUILD_CONTEXT_LIMIT"), DefaultContextSizeHardLimit)
)
View Source
var ErrDockerfileNotFound = errors.New("dockerfile not found")

Functions

func FixupServices

func FixupServices(ctx context.Context, provider client.Provider, project *composeTypes.Project, upload UploadMode) error

func GetImageRepo

func GetImageRepo(image string) string

func GetNumOfGPUs

func GetNumOfGPUs(services composeTypes.Services) int

func IsMongoRepo

func IsMongoRepo(repo string) bool

func IsPostgresRepo

func IsPostgresRepo(repo string) bool

func IsRedisRepo

func IsRedisRepo(repo string) bool

func IsSecret

func IsSecret(input string) (bool, error)

func NormalizeServiceName

func NormalizeServiceName(s string) string

func ValidateProject

func ValidateProject(project *composeTypes.Project) error

func ValidateProjectConfig

func ValidateProjectConfig(ctx context.Context, composeProject *composeTypes.Project, listConfigNamesFunc ListConfigNamesFunc) error

func ValidateService

func ValidateService(service *types.ServiceConfig) error

func WalkContextFolder

func WalkContextFolder(root, dockerfile string, fn func(path string, de os.DirEntry, slashPath string) error) error

Types

type ArchiveType

type ArchiveType string
const ArchiveTypeGzip ArchiveType = "application/gzip"
const ArchiveTypeZip ArchiveType = "application/zip"

type ErrMissingConfig

type ErrMissingConfig []string

func (ErrMissingConfig) Error

func (e ErrMissingConfig) Error() string

type FixupTarget

type FixupTarget string
const (
	BuildArgs       FixupTarget = "build argument"
	EnvironmentVars FixupTarget = "environment variable"
)

type ListConfigNamesFunc

type ListConfigNamesFunc func(context.Context) ([]string, error)

type Loader

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

func NewLoader

func NewLoader(opts ...LoaderOption) *Loader

func (*Loader) LoadProject

func (c *Loader) LoadProject(ctx context.Context) (*Project, error)

func (*Loader) LoadProjectName

func (c *Loader) LoadProjectName(ctx context.Context) (string, error)

func (*Loader) NewProjectOptions

func (c *Loader) NewProjectOptions() (*cli.ProjectOptions, error)

type LoaderOption

type LoaderOption func(*LoaderOptions)

func WithPath

func WithPath(paths ...string) LoaderOption

func WithProjectName

func WithProjectName(name string) LoaderOption

type LoaderOptions

type LoaderOptions struct {
	ConfigPaths []string
	ProjectName string
}

type Project

type Project = composeTypes.Project

func LoadFromContent

func LoadFromContent(ctx context.Context, content []byte, nameFallback string) (*Project, error)

func LoadFromContentWithInterpolation

func LoadFromContentWithInterpolation(ctx context.Context, content []byte, nameFallback string) (*Project, error)

type ServiceConfig

type ServiceConfig = composeTypes.ServiceConfig

type ServiceNameReplacer

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

func NewServiceNameReplacer

func NewServiceNameReplacer(provider client.Provider, project *composeTypes.Project) ServiceNameReplacer

func (*ServiceNameReplacer) HasServiceName

func (s *ServiceNameReplacer) HasServiceName(name string) bool

func (*ServiceNameReplacer) ReplaceServiceNameWithDNS

func (s *ServiceNameReplacer) ReplaceServiceNameWithDNS(serviceName string, key, value string, fixupTarget FixupTarget) string

type Services

type Services = composeTypes.Services

type UploadMode

type UploadMode int
const (
	UploadModeDigest   UploadMode = iota // the default: calculate the digest of the tarball so we can skip building the same image twice
	UploadModeForce                      // force: always upload the tarball, even if it's the same as a previous one
	UploadModeIgnore                     // dry-run: don't upload the tarball, just return the path
	UploadModePreview                    // preview: like dry-run but does start the preview command
	UploadModeEstimate                   // cost estimation: like preview, but skips the tarball
)

type WriterFactory

type WriterFactory interface {
	CreateHeader(info fs.FileInfo, slashPath string) (io.Writer, error)
	Close() error
}

Jump to

Keyboard shortcuts

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