v0.8.0 Latest Latest

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

Go to latest
Published: Jun 11, 2019 License: Apache-2.0 Imports: 9 Imported by: 22




View Source
const SingleFileSeparator = "\n---\n"

SingleFileSeparator is the separator used in single-file app


This section is empty.


func Metadata

func Metadata(r io.Reader) func(*App) error

Metadata adds the specified metadata reader to the app

func MetadataFile

func MetadataFile(file string) func(*App) error

MetadataFile adds the specified metadata file to the app

func WithAttachments added in v0.6.0

func WithAttachments(rootAppDir string) func(*App) error

WithAttachments adds all local files (exc. main files) to the app

func WithCleanup

func WithCleanup(f func()) func(*App) error

WithCleanup sets the cleanup function of the app

func WithComposeFiles

func WithComposeFiles(files ...string) func(*App) error

WithComposeFiles adds the specified compose files to the app

func WithComposes

func WithComposes(readers ...io.Reader) func(*App) error

WithComposes adds the specified compose readers to the app

func WithName

func WithName(name string) func(*App) error

WithName sets the application name

func WithParameters added in v0.8.0

func WithParameters(readers ...io.Reader) func(*App) error

WithParameters adds the specified parameters readers to the app

func WithParametersFiles added in v0.8.0

func WithParametersFiles(files ...string) func(*App) error

WithParametersFiles adds the specified parameters files to the app

func WithPath

func WithPath(path string) func(*App) error

WithPath sets the original path of the app

func WithSource added in v0.6.0

func WithSource(source AppSourceKind) func(*App) error

WithSource sets the source of the app


type App

type App struct {
	Name    string
	Path    string
	Cleanup func()
	Source  AppSourceKind
	// contains filtered or unexported fields

App represents an app

func NewApp

func NewApp(path string, ops ...func(*App) error) (*App, error)

NewApp creates a new docker app with the specified path and struct modifiers

func NewAppFromDefaultFiles

func NewAppFromDefaultFiles(path string, ops ...func(*App) error) (*App, error)

NewAppFromDefaultFiles creates a new docker app using the default files in the specified path. If one of those file doesn't exists, it will error out.

func (*App) Attachments added in v0.6.0

func (a *App) Attachments() []Attachment

Attachments returns the external files list

func (*App) Composes

func (a *App) Composes() [][]byte

Composes returns compose files content

func (*App) Extract added in v0.4.1

func (a *App) Extract(path string) error

Extract writes the app in the specified folder

func (*App) Metadata

func (a *App) Metadata() metadata.AppMetadata

Metadata returns the metadata struct

func (*App) MetadataRaw added in v0.5.0

func (a *App) MetadataRaw() []byte

MetadataRaw returns metadata file content

func (*App) Parameters added in v0.8.0

func (a *App) Parameters() parameters.Parameters

Parameters returns map of parameters

func (*App) ParametersRaw added in v0.8.0

func (a *App) ParametersRaw() [][]byte

ParametersRaw returns parameter files content

type AppSourceKind added in v0.6.0

type AppSourceKind int

AppSourceKind represents what format the app was in when read

const (
	// AppSourceSplit represents an Application in multiple file format
	AppSourceSplit AppSourceKind = iota
	// AppSourceMerged represents an Application in single file format
	// AppSourceImage represents an Application pulled from an image
	// AppSourceArchive represents an Application in an archive format

func (AppSourceKind) ShouldRunInsideDirectory added in v0.8.0

func (a AppSourceKind) ShouldRunInsideDirectory() bool

ShouldRunInsideDirectory returns whether the package is run from a directory on disk

type Attachment added in v0.6.0

type Attachment struct {
	// contains filtered or unexported fields

Attachment is a summary of an attachment (attached file) stored in the app definition

func (*Attachment) Path added in v0.6.0

func (f *Attachment) Path() string

Path returns the local file path

func (*Attachment) Size added in v0.6.0

func (f *Attachment) Size() int64

Size returns the file size in bytes

type InitialComposeFile

type InitialComposeFile struct {
	Version  string
	Services map[string]InitialService

InitialComposeFile represents an initial composefile (used by the init command)

func NewInitialComposeFile

func NewInitialComposeFile() InitialComposeFile

NewInitialComposeFile returns an empty InitialComposeFile object

type InitialService

type InitialService struct {
	Image string

InitialService represents an initial service (used by the init command)


Path Synopsis

Jump to

Keyboard shortcuts

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