common

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ComposeFileName filename used for the docker compose file.
	ComposeFileName = "docker-compose.yaml"
)

Variables

View Source
var BuildDict = map[string]string{
	"authservice":     "app-edge",
	"gateway-mt":      "app-edge",
	"linksharing":     "app-edge",
	"satellite-admin": "app-storj",
	"satellite-api":   "app-storj",
	"satellite-core":  "app-storj",
	"storagenode":     "app-storj",
	"uplink":          "app-storj",
	"versioncontrol":  "app-storj",
}

BuildDict stores the name of the container to build for Storj services.

View Source
var Satellite0Identity = "12whfK1EDvHJtajBiAUeajQLYcWqxcQmdYQU5zX5cCf6bAxfgu4"

Satellite0Identity is a standard test identity included in our compose files.

Store is the VersionStore used for compose file history.

Functions

func ContainsService

func ContainsService(s []types.ServiceConfig, e string) bool

ContainsService check if the service is included in the list.

func CreateBind

func CreateBind(source string, target string) types.ServiceVolumeConfig

CreateBind can create a new volume binding object.

func ExtractFile

func ExtractFile(path, fileName string, content []byte) error

ExtractFile extract embedded file, if doesn't exist.

func GetTestAPIKey

func GetTestAPIKey(satelliteID string) (string, error)

GetTestAPIKey can calculate an access grant for the predefined test users/project.

func IsRegularFile

func IsRegularFile(path string) error

IsRegularFile checks to see there is a regular file at the given path and returns an error otherwise.

func LoadComposeFromBytes

func LoadComposeFromBytes(composeBytes []byte) (*types.Project, error)

LoadComposeFromBytes loads docker-compose definition from bytes.

func LoadComposeFromFile

func LoadComposeFromFile(dir string, filename string) (*types.Project, error)

LoadComposeFromFile parses docker-compose file from the current directory.

func ParseArgumentsWithSelector

func ParseArgumentsWithSelector(args []string, argNo int) ([]string, []string, error)

ParseArgumentsWithSelector separate the selector and real arguments from os args.

func ResolveBuilds

func ResolveBuilds(services []string) (map[string]string, error)

ResolveBuilds returns with the required docker images to build (as keys in the maps).

func ResolveServices

func ResolveServices(selectors []string) ([]string, error)

ResolveServices replaces group definition with exact services in the list.

func WriteComposeFile

func WriteComposeFile(dir string, compose *types.Project) error

WriteComposeFile persists current docker-compose project to docker-compose.yaml.

func WriteComposeFileNoHistory

func WriteComposeFileNoHistory(dir string, compose *types.Project) error

WriteComposeFileNoHistory persists current docker-compose project to docker-compose.yaml without saving a record of the current compose file.

Types

type ComposeFile

type ComposeFile struct {
	Version  string // used for compatibility with Compose V1
	Services types.Services
}

ComposeFile is the simplified structure of one compose file.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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