compose

package
v0.8.7-323-g4ef4dd73 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: BSD-3-Clause Imports: 23 Imported by: 0

Documentation

Overview

Package compose provides primitives for running Unikraft applications via the Compose specification.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2024, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.

Index

Constants

This section is empty.

Variables

View Source
var DefaultFileNames = []string{
	"docker-compose.yml",
	"docker-compose.yaml",
	"compose.yml",
	"compose.yaml",
	"Composefile",
}

DefaultFileNames is a list of default compose file names to look for

View Source
var ErrInvalidComposefile = fmt.Errorf("the Composefile for the project is either missing or invalid")

Functions

func NewComposeProjectV1 added in v0.7.4

func NewComposeProjectV1(ctx context.Context, opts ...any) (composev1.ComposeService, error)

Types

type Project

type Project struct {
	*types.Project `json:"project"` // The underlying compose-go project
}

func NewProjectFromComposeFile

func NewProjectFromComposeFile(ctx context.Context, workdir, composefile string) (*Project, error)

NewProjectFromComposeFile loads a compose file and returns a project. If no compose file is specified, it will look for one in the current directory.

func (*Project) AssignIPs added in v0.7.11

func (project *Project) AssignIPs(ctx context.Context) error

func (*Project) ServicesOrderedByDependencies added in v0.8.7

func (project *Project) ServicesOrderedByDependencies(ctx context.Context, services types.Services, expand bool) []types.ServiceConfig

ServicesOrderedByDependencies receives a list of services and generates a new list ordered by dependencies. If expand is set, it will also include dependencies not present in the original list.

func (*Project) ServicesReversedByDependencies added in v0.8.7

func (project *Project) ServicesReversedByDependencies(ctx context.Context, services types.Services, expand bool) []types.ServiceConfig

ServicesReversedWithDependants receives a list of services and generates a new list reverse ordered by dependencies. If expand is set, it will also include dependendants not present in the original list.

func (*Project) Validate

func (project *Project) Validate(ctx context.Context) error

Validate performs some early checks on the project to ensure it is valid, as well as fill in some unspecified fields.

Jump to

Keyboard shortcuts

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