app

package
v0.0.0-...-23a443e Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeProtosc = "protosc"
	TypeProtosd = "protosd"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {

	// Public members
	Name          string `json:"name"`
	ID            string `json:"id"`
	InstallerRef  string `json:"installer-ref"`
	InstanceID    string `json:"instance-id"`
	DesiredStatus string `json:"desired-status"`
	IP            net.IP `json:"ip"`
	Persistence   bool   `json:"persistence"`
	// contains filtered or unexported fields
}

App represents the application state

func (*App) GetID

func (app *App) GetID() string

GetID returns the id of the application

func (*App) GetIP

func (app *App) GetIP() net.IP

GetIP returns the ip address of the app

func (*App) GetName

func (app *App) GetName() string

GetName returns the id of the application

func (*App) GetStatus

func (app *App) GetStatus() string

GetStatus returns the status of an application

func (*App) GetVersion

func (app *App) GetVersion() string

GetVersion returns the version of an application

func (*App) Start

func (app *App) Start() error

Start starts an application

func (*App) Stop

func (app *App) Stop() error

Stop stops an application

type Config

type Config struct {
	Description string
	Image       string
	Ports       map[string]string
	Data        string
}

Config the application config

type Manager

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

Manager keeps track of all the apps

func CreateManager

func CreateManager(ptype string, runtime runtime.RuntimePlatform, db *db.DB) *Manager

CreateManager returns a Manager, which implements the *AppManager interface

func (*Manager) Create

func (am *Manager) Create(installer string, name string, instanceName string, persistence bool, installerParams map[string]string) (*App, error)

Create takes an image and creates an application, without starting it

func (*Manager) Get

func (am *Manager) Get(id string) (App, error)

Get returns a copy of an application based on its name

func (*Manager) GetAll

func (am *Manager) GetAll() ([]App, error)

GetAll returns a copy of all the applications

func (*Manager) GetByID

func (am *Manager) GetByID(id string) (App, error)

GetByID returns an application based on its id

func (*Manager) GetByIntance

func (am *Manager) GetByIntance(instance string) ([]App, error)

GetAll returns a copy of all the applications

func (*Manager) GetLogs

func (am *Manager) GetLogs(name string) ([]byte, error)

GetLogs retrieves the logs for a specific app

func (*Manager) GetStatus

func (am *Manager) GetStatus(name string) (string, error)

GetLogs retrieves the logs for a specific app

func (*Manager) Notify

func (am *Manager) Notify()

Refresh checks the db for new apps and deploys them if they belong to the current instance

func (*Manager) Remove

func (am *Manager) Remove(id string) error

Remove removes an application based on the provided id

func (*Manager) Start

func (am *Manager) Start(name string) error

Start sets the desired status of the app to stopped, which triggers the stopping of the app on the hosting instance

func (*Manager) Stop

func (am *Manager) Stop(name string) error

Stop sets the desired status of the app to stopped, which triggers the stopping of the app on the hosting instance

Jump to

Keyboard shortcuts

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