model

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSimpleFileMatcher

func NewSimpleFileMatcher(paths ...string) (fileMatcher, error)

Types

type Cmd

type Cmd struct {
	Argv []string
}

func ToShellCmd

func ToShellCmd(cmd string) Cmd

func ToShellCmds

func ToShellCmds(cmds []string) []Cmd

func TrySquash

func TrySquash(steps []Cmd) []Cmd

func (Cmd) Empty

func (c Cmd) Empty() bool

func (Cmd) EntrypointStr

func (c Cmd) EntrypointStr() string

func (Cmd) Equal

func (c1 Cmd) Equal(c2 Cmd) bool

func (Cmd) IsShellStandardForm

func (c Cmd) IsShellStandardForm() bool

func (Cmd) RunStr

func (c Cmd) RunStr() string

func (Cmd) ShellStandardScript

func (c Cmd) ShellStandardScript() string

Get the script when the shell is in standard form. Panics if the command is not in shell standard form.

func (Cmd) String

func (c Cmd) String() string

type CompositePathMatcher

type CompositePathMatcher struct {
	Matchers []PathMatcher
}

func (CompositePathMatcher) Matches

func (c CompositePathMatcher) Matches(f string, isDir bool) (bool, error)

type CompositePatternMatcher

type CompositePatternMatcher struct {
	CompositePathMatcher
	Matchers []PatternMatcher
}

func (CompositePatternMatcher) AsMatchPatterns

func (c CompositePatternMatcher) AsMatchPatterns() []string

type LocalGithubRepo

type LocalGithubRepo struct {
	LocalPath            string
	DockerignoreContents string
	GitignoreContents    string
}

func (LocalGithubRepo) Equal

func (r1 LocalGithubRepo) Equal(r2 LocalGithubRepo) bool

func (LocalGithubRepo) IsRepo

func (LocalGithubRepo) IsRepo()

type Manifest

type Manifest struct {
	// Properties for all builds.
	Name         ManifestName
	K8sYaml      string
	TiltFilename string
	DockerRef    reference.Named
	PortForwards []PortForward

	// Local files read while reading the Tilt configuration.
	// If these files are changed, we should reload the manifest.
	ConfigFiles []string

	// Properties for fast_build (builds that support
	// iteration based on past artifacts)
	BaseDockerfile string
	Mounts         []Mount
	Steps          []Step
	Entrypoint     Cmd

	// From static_build. If StaticDockerfile is populated,
	// we do not expect the iterative build fields to be populated.
	StaticDockerfile string
	StaticBuildPath  string // the absolute path to the files

	Repos []LocalGithubRepo
}

NOTE: If you modify Manifest, make sure to modify `Manifest.Equal` appropriately

func (Manifest) ConfigMatcher

func (m Manifest) ConfigMatcher() (PathMatcher, error)

func (Manifest) Equal

func (m1 Manifest) Equal(m2 Manifest) bool

func (Manifest) IsStaticBuild

func (m Manifest) IsStaticBuild() bool

func (Manifest) LocalPaths

func (m Manifest) LocalPaths() []string

func (Manifest) Validate

func (m Manifest) Validate() error

type ManifestName

type ManifestName string

func (ManifestName) String

func (m ManifestName) String() string

type Mount

type Mount struct {
	LocalPath     string
	ContainerPath string
}

type PathMatcher

type PathMatcher interface {
	Matches(f string, isDir bool) (bool, error)
}
var EmptyMatcher PathMatcher = emptyMatcher{}

func NewCompositeMatcher

func NewCompositeMatcher(matchers []PathMatcher) PathMatcher

type PatternMatcher

type PatternMatcher interface {
	PathMatcher

	// Express this PathMatcher as a sequence of filepath.Match
	// patterns. These patterns are widely useful in Docker-land because
	// they're suitable in .dockerignore or Dockerfile ADD statements
	// https://docs.docker.com/engine/reference/builder/#add
	AsMatchPatterns() []string
}

type PortForward

type PortForward struct {
	// The port to expose on localhost of the current machine.
	LocalPort int

	// The port to connect to inside the deployed container.
	// If 0, we will connect to the first containerPort.
	ContainerPort int
}

type Step

type Step struct {
	// Required. The command to run in this step.
	Cmd Cmd
	// Optional. If not specified, this step runs on every change.
	// If specified, we only run the Cmd if the trigger matches the changed file.
	Triggers []string
	// Directory the Triggers are relative to
	BaseDirectory string
}

func ToShellSteps

func ToShellSteps(cwd string, cmds []string) []Step

func ToStep

func ToStep(cwd string, cmd Cmd) Step

func ToSteps

func ToSteps(cwd string, cmds []Cmd) []Step

func (Step) Equal

func (s1 Step) Equal(s2 Step) bool

type ValidateErr

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

func (*ValidateErr) Error

func (e *ValidateErr) Error() string

Jump to

Keyboard shortcuts

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