platformifier

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

type FS interface {
	Create(name string) (io.WriteCloser, error)
	Find(root, name string, firstMatch bool) []string
	Open(name string, flag int, perm os.FileMode) (io.ReadWriteCloser, error)
}

type OSFileSystem

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

func NewOSFileSystem

func NewOSFileSystem(root string) *OSFileSystem

func (*OSFileSystem) Create

func (f *OSFileSystem) Create(name string) (io.WriteCloser, error)

func (*OSFileSystem) Find

func (f *OSFileSystem) Find(root, name string, firstMatch bool) []string

Find searches for the file inside the path recursively and returns all matches

func (*OSFileSystem) Open

func (f *OSFileSystem) Open(name string, flag int, perm os.FileMode) (io.ReadWriteCloser, error)

type Platformifier

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

A Platformifier handles the business logic of a given runtime to platformify.

func New

func New(input *UserInput, flavor string, fileSystems ...FS) *Platformifier

New creates Platformifier with the appropriate platformifier stack based on UserInput.

func (*Platformifier) Platformify

func (p *Platformifier) Platformify(ctx context.Context) error

type Service

type Service struct {
	Name         string
	Type         string
	TypeVersions []string
	Disk         string
	DiskSizes    []string
}

Service contains the configuration for a service needed by the application.

type Stack

type Stack int
const (
	Generic Stack = iota
	Django
	Laravel
	NextJS
	Strapi
	Flask
	Express
)

func (Stack) Name

func (s Stack) Name() string

type UserInput

type UserInput struct {
	Stack              Stack
	Root               string
	ApplicationRoot    string
	Name               string
	Type               string
	Runtime            string
	Environment        map[string]string
	BuildSteps         []string
	WebCommand         string
	SocketFamily       string
	DeployCommand      []string
	DependencyManagers []string
	Locations          map[string]map[string]interface{}
	Dependencies       map[string]map[string]string
	BuildFlavor        string
	Disk               string
	Mounts             map[string]map[string]string
	Services           []Service
	Relationships      map[string]string
	WorkingDirectory   string
	HasGit             bool
}

UserInput contains the configuration from user input.

func (*UserInput) Cache

func (ui *UserInput) Cache() string

Cache returns the first service that is a cache.

func (*UserInput) CacheUpper added in v0.2.3

func (ui *UserInput) CacheUpper() string

CacheUpper returns the uppercase slug for the first service that is a cache.

func (*UserInput) Database

func (ui *UserInput) Database() string

Database returns the first service that is a database.

func (*UserInput) DatabaseUpper added in v0.2.3

func (ui *UserInput) DatabaseUpper() string

DatabaseUpper returns the uppercase slug for the first service that is a database.

Jump to

Keyboard shortcuts

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