application

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ManifestFile = "manifest.json"
)
View Source
const (
	ProjectManifest = "project.json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	UID      string         `json:"uid"`
	Manifest types.Manifest `json:"manifest"`
	// contains filtered or unexported fields
}

func CreateApp

func CreateApp(location string, creds *syscall.Credential, manifest types.Manifest) (*App, error)

func OpenApp

func OpenApp(location string, creds *syscall.Credential) (*App, error)

func (*App) ApplyOwner

func (app *App) ApplyOwner() error

func (*App) File

func (app *App) File(filename string) (string, error)

func (*App) InvokeAction added in v0.2.2

func (app *App) InvokeAction(ctx context.Context, name string) (string, error)

Invoke action by name (make target)

func (*App) ListActions added in v0.2.2

func (app *App) ListActions() ([]string, error)

List Make actions (if Makefile defined)

func (*App) ManifestFile

func (app *App) ManifestFile() string

func (*App) ReadFile

func (app *App) ReadFile(filename string) ([]byte, error)

func (*App) Run

func (app *App) Run(ctx context.Context, tracker stats.Recorder, creds *syscall.Credential, w http.ResponseWriter, r *http.Request)

Run application with parameters defined in manifest in directory

func (*App) Touch

func (app *App) Touch(filename string, dir bool) error

func (*App) WriteFile

func (app *App) WriteFile(filename string, content []byte) error

type Project

type Project struct {
	ProjectConfig
	// contains filtered or unexported fields
}

func OpenProject

func OpenProject(location string, defaultConfig ProjectConfig) (*Project, error)

func (*Project) ApplyConfig

func (project *Project) ApplyConfig(cfg ProjectConfig) error

Replace project config and do necessary updates.

If user changed - update all credentials in project and in apps, apply ownership for all files

func (*Project) Create

func (project *Project) Create(ctx context.Context) (*App, error)

func (*Project) CreateFromTemplate

func (project *Project) CreateFromTemplate(ctx context.Context, template *templates.Template) (*App, error)

func (*Project) Credentials

func (project *Project) Credentials() *syscall.Credential

func (*Project) Download

func (project *Project) Download(ctx context.Context, uid string, tarGzBall io.Writer) error

func (*Project) FindApp

func (project *Project) FindApp(uid string) *App

func (*Project) FindAppByAlias added in v0.2.3

func (project *Project) FindAppByAlias(alias string) *App

func (*Project) Handler

func (project *Project) Handler(ctx context.Context, tracker stats.Recorder) (http.HandlerFunc, error)

Handler for incoming requests

func (*Project) HandlerAlias added in v0.2.3

func (project *Project) HandlerAlias(ctx context.Context, tracker stats.Recorder) (http.HandlerFunc, error)

Handler for incoming requests

func (project *Project) Link(uid string, alias string) (*App, error)

func (*Project) List

func (project *Project) List() []*App

func (*Project) Remove

func (project *Project) Remove(ctx context.Context, uid string) error

func (*Project) Root

func (project *Project) Root() string

root directory to search for applications

func (*Project) Save

func (project *Project) Save() error
func (project *Project) Unlink(alias string) (*App, error)

func (*Project) Upload

func (project *Project) Upload(ctx context.Context, uid string, tarGzBall io.Reader) error

type ProjectConfig

type ProjectConfig struct {
	User  string   `json:"user"`            // user that will be used for jobs
	UnTar []string `json:"untar,omitempty"` // custom tar zxf command
	Tar   []string `json:"tar,omitempty"`   // custom tar zcf command
}

func (*ProjectConfig) Credentials

func (project *ProjectConfig) Credentials() (*syscall.Credential, error)

func (*ProjectConfig) LoadOrCreate

func (project *ProjectConfig) LoadOrCreate(file string) (*Project, error)

func (*ProjectConfig) TarCommand

func (project *ProjectConfig) TarCommand() []string

func (*ProjectConfig) UnTarCommand

func (project *ProjectConfig) UnTarCommand() []string

Jump to

Keyboard shortcuts

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