runtime

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	WriteFiles(directory string) error
	ReadFile(path string) (string, error)
	ListFiles(path string) ([]os.FileInfo, error)
}

func NewClient added in v0.5.0

func NewClient(location Location) (Client, error)

type CustomRuntime added in v0.5.0

type CustomRuntime struct {
	Details
}

func (CustomRuntime) Build added in v0.5.0

func (runtime CustomRuntime) Build(ctx context.Context) error

Build runtime, in case of a custom runtime just log the action

func (CustomRuntime) BuildDryRun added in v0.6.0

func (runtime CustomRuntime) BuildDryRun() (string, error)

Build runtime DryRun

func (CustomRuntime) DockerfilePath added in v0.5.0

func (runtime CustomRuntime) DockerfilePath() string

Return an expected path to a custom Dockerfile

type Details

type Details struct {
	FunctionName    string
	FunctionFile    string
	FunctionHandler string
	FunctionRuntime string
	CodeDirectory   string
	ResultingImage  string
}

func (Details) Directory added in v0.5.0

func (details Details) Directory() string

func (Details) Image added in v0.5.0

func (details Details) Image() string

type GeneratedRuntime added in v0.5.0

type GeneratedRuntime struct {
	Details
}

func (GeneratedRuntime) Build added in v0.5.0

func (runtime GeneratedRuntime) Build(ctx context.Context) error

Build runtime files and persist them in CodeDirectory

func (GeneratedRuntime) BuildDryRun added in v0.6.0

func (runtime GeneratedRuntime) BuildDryRun() (string, error)

func (GeneratedRuntime) DockerfilePath added in v0.5.0

func (runtime GeneratedRuntime) DockerfilePath() string

func (GeneratedRuntime) RuntimeAddress added in v0.7.0

func (runtime GeneratedRuntime) RuntimeAddress() string

func (GeneratedRuntime) Slug added in v0.5.0

func (runtime GeneratedRuntime) Slug() string

type GoGit

type GoGit struct {
	Location
	*git.Repository
	billy.Filesystem
}

func (*GoGit) ListFiles added in v0.7.1

func (client *GoGit) ListFiles(path string) ([]os.FileInfo, error)

func (*GoGit) ReadFile

func (client *GoGit) ReadFile(path string) (string, error)

func (*GoGit) WriteFiles added in v0.5.0

func (client *GoGit) WriteFiles(directory string) error

type Location

type Location struct {
	Address   string
	Reference string
}

type MockClient added in v0.6.0

type MockClient struct {
	mock.Mock
}

func (*MockClient) ListFiles added in v0.7.1

func (client *MockClient) ListFiles(path string) ([]os.FileInfo, error)

func (*MockClient) ReadFile added in v0.6.0

func (client *MockClient) ReadFile(path string) (string, error)

func (*MockClient) WriteFiles added in v0.6.0

func (client *MockClient) WriteFiles(directory string) error

type MockFileInfo added in v0.7.1

type MockFileInfo struct {
	mock.Mock
}

func (*MockFileInfo) IsDir added in v0.7.1

func (file *MockFileInfo) IsDir() bool

func (*MockFileInfo) ModTime added in v0.7.1

func (file *MockFileInfo) ModTime() time.Time

func (*MockFileInfo) Mode added in v0.7.1

func (file *MockFileInfo) Mode() os.FileMode

func (*MockFileInfo) Name added in v0.7.1

func (file *MockFileInfo) Name() string

func (*MockFileInfo) Size added in v0.7.1

func (file *MockFileInfo) Size() int64

func (*MockFileInfo) Sys added in v0.7.1

func (file *MockFileInfo) Sys() interface{}

type MockRuntime added in v0.6.0

type MockRuntime struct {
	mock.Mock
}

func (*MockRuntime) Build added in v0.6.0

func (runtime *MockRuntime) Build(ctx context.Context) error

func (*MockRuntime) BuildDryRun added in v0.6.0

func (runtime *MockRuntime) BuildDryRun() (string, error)

func (*MockRuntime) Directory added in v0.6.0

func (runtime *MockRuntime) Directory() string

func (*MockRuntime) DockerfilePath added in v0.6.0

func (runtime *MockRuntime) DockerfilePath() string

func (*MockRuntime) Image added in v0.6.0

func (runtime *MockRuntime) Image() string

type OpenfaasRuntime added in v0.7.1

type OpenfaasRuntime struct {
	Details
}

func (OpenfaasRuntime) Build added in v0.7.1

func (runtime OpenfaasRuntime) Build(ctx context.Context) error

func (OpenfaasRuntime) BuildDryRun added in v0.7.1

func (runtime OpenfaasRuntime) BuildDryRun() (string, error)

func (OpenfaasRuntime) DockerfilePath added in v0.7.1

func (runtime OpenfaasRuntime) DockerfilePath() string

type Repository

type Repository struct {
	Location
	Client
}

func NewRepository

func NewRepository(address string) *Repository

type Runtime

type Runtime interface {
	BuildDryRun() (string, error)
	Build(ctx context.Context) error
	Directory() string
	Image() string
	DockerfilePath() string
}

func New

func New(details Details) Runtime

Creates a new runtime using Runtime Details.

If a runtime contains a runtime address it means that this is a runtime we need to generate. Otherwise it is mostly likely the CustomRuntime, meaning that there should be Dockerfile provided by a user.

type Template

type Template struct {
	Filename   string
	Contents   string
	Attributes Details
}

func (Template) Parse added in v0.5.0

func (template Template) Parse() (string, error)

Parse a template, and return a string

func (Template) Write added in v0.5.0

func (template Template) Write() error

Write parsed template to a file on disk

Jump to

Keyboard shortcuts

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