Documentation
¶
Index ¶
- Constants
- type App
- func (app *App) ApplyOwner() error
- func (app *App) File(filename string) (string, error)
- func (app *App) InvokeAction(ctx context.Context, name string, timeLimit time.Duration, ...) (string, error)
- func (app *App) ListActions() ([]string, error)
- func (app *App) ManifestFile() string
- func (app *App) ReadFile(filename string) ([]byte, error)
- func (app *App) Run(ctx context.Context, tracker stats.Recorder, env map[string]string, ...)
- func (app *App) RunScheduled(ctx context.Context, last, now time.Time, globalEnv map[string]string)
- func (app *App) Touch(filename string, dir bool) error
- func (app *App) WriteFile(filename string, content []byte) error
- type Project
- func (project *Project) ChangeUser(user string) error
- func (project *Project) CloneApps() []*App
- func (project *Project) Create(ctx context.Context) (*App, error)
- func (project *Project) CreateFromGit(ctx context.Context, repo string) (*App, error)
- func (project *Project) CreateFromTemplate(ctx context.Context, template *templates.Template) (*App, error)
- func (project *Project) Credentials() *syscall.Credential
- func (project *Project) Download(ctx context.Context, uid string, tarGzBall io.Writer) error
- func (project *Project) FindApp(uid string) *App
- func (project *Project) FindAppByAlias(alias string) *App
- func (project *Project) GlobalEnvironment() map[string]string
- func (project *Project) Handler(ctx context.Context, tracker stats.Recorder) (http.HandlerFunc, error)
- func (project *Project) HandlerAlias(ctx context.Context, tracker stats.Recorder) (http.HandlerFunc, error)
- func (project *Project) Link(uid string, alias string) (*App, error)
- func (project *Project) List() []*App
- func (project *Project) PublicKey() []byte
- func (project *Project) Remove(ctx context.Context, uid string) error
- func (project *Project) Root() string
- func (project *Project) RunCron(ctx context.Context)
- func (project *Project) RunnerUser() string
- func (project *Project) Save() error
- func (project *Project) SetGlobalEnvironment(env map[string]string) error
- func (project *Project) SetupSSHKey(file string) error
- func (project *Project) Unlink(alias string) (*App, error)
- func (project *Project) Upload(ctx context.Context, uid string, tarGzBall io.Reader) error
- type ProjectConfig
- func (cfg *ProjectConfig) Credentials() (*syscall.Credential, error)
- func (cfg *ProjectConfig) LoadOrCreate(file string) (*Project, error)
- func (cfg *ProjectConfig) ReadFile(file string) error
- func (cfg *ProjectConfig) TarCommand() []string
- func (cfg *ProjectConfig) UnTarCommand() []string
- func (cfg *ProjectConfig) WriteFile(file string) error
Constants ¶
View Source
const ( ProjectManifest = "project.json" CGIIgnore = ".cgiignore" SSHKeySize = 3072 )
View Source
const (
ManifestFile = "manifest.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"`
IsGit bool `json:"git"`
// contains filtered or unexported fields
}
func CreateAppGit ¶ added in v0.2.8
func (*App) ApplyOwner ¶
func (*App) InvokeAction ¶ added in v0.2.2
func (app *App) InvokeAction(ctx context.Context, name string, timeLimit time.Duration, globalEnv map[string]string) (string, error)
Invoke action by name (make target)
func (*App) ListActions ¶ added in v0.2.2
List Make actions (if Makefile defined)
func (*App) ManifestFile ¶
func (*App) Run ¶
func (app *App) Run(ctx context.Context, tracker stats.Recorder, env map[string]string, w http.ResponseWriter, r *http.Request)
Run application with parameters defined in manifest in directory
func (*App) RunScheduled ¶ added in v0.2.5
type Project ¶
type Project struct {
// contains filtered or unexported fields
}
func OpenProject ¶
func OpenProject(location string, defaultConfig ProjectConfig) (*Project, error)
func (*Project) ChangeUser ¶ added in v0.2.8
func (*Project) CreateFromGit ¶ added in v0.2.8
func (*Project) CreateFromTemplate ¶
func (*Project) Credentials ¶
func (project *Project) Credentials() *syscall.Credential
func (*Project) FindAppByAlias ¶ added in v0.2.3
func (*Project) GlobalEnvironment ¶ added in v0.2.8
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) PublicKey ¶ added in v0.2.8
Gets encoded public key if exists. Otherwise returns nil
func (*Project) RunnerUser ¶ added in v0.2.8
func (*Project) SetGlobalEnvironment ¶ added in v0.2.8
func (*Project) SetupSSHKey ¶ added in v0.2.8
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
Environment map[string]string `json:"environment,omitempty"` // global environment
}
func (*ProjectConfig) Credentials ¶
func (cfg *ProjectConfig) Credentials() (*syscall.Credential, error)
func (*ProjectConfig) LoadOrCreate ¶
func (cfg *ProjectConfig) LoadOrCreate(file string) (*Project, error)
Open project: load or create project based on config, defined parameters will be used as default
func (*ProjectConfig) ReadFile ¶ added in v0.2.8
func (cfg *ProjectConfig) ReadFile(file string) error
func (*ProjectConfig) TarCommand ¶
func (cfg *ProjectConfig) TarCommand() []string
func (*ProjectConfig) UnTarCommand ¶
func (cfg *ProjectConfig) UnTarCommand() []string
func (*ProjectConfig) WriteFile ¶ added in v0.2.8
func (cfg *ProjectConfig) WriteFile(file string) error
Click to show internal directories.
Click to hide internal directories.