core

package
v0.0.0-...-c5e44dc Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2025 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DEF_REMOTE = "origin"

Variables

View Source
var ProjectDeployment = map[db.ProjectType]DeserializeFunc{
	db.ProjectTypeDockerfile: func(b []byte) (DeployFunc, error) {
		var v Dockerfile
		err := json.Unmarshal(b, &v)
		if err != nil {
			return nil, err
		}
		return func() error {
			return nil
		}, nil
	},
	db.ProjectTypeCompose: func(b []byte) (DeployFunc, error) {
		var v DockerCompose
		err := json.Unmarshal(b, &v)
		if err != nil {
			return nil, err
		}
		return func() error {
			return nil
		}, nil
	},
	db.ProjectTypeShell: func(b []byte) (DeployFunc, error) {
		var v ShellScript
		err := json.Unmarshal(b, &v)
		if err != nil {
			return nil, err
		}
		return func() error {
			return nil
		}, nil
	},
	db.ProjectTypeCommand: func(b []byte) (DeployFunc, error) {
		var v SingleCommand
		err := json.Unmarshal(b, &v)
		if err != nil {
			return nil, err
		}
		return func() error {
			return nil
		}, nil
	},
}

Functions

func CloneRepository

func CloneRepository(projectName, repoOwner, repoName, branch, gho string) error

func DeployProject

func DeployProject(dInfo ProjectDeploymentInfo, opts *DeployParams) error

func PullRepository

func PullRepository(projectName, gho string) error

Types

type DeployFunc

type DeployFunc func() error

type DeployParams

type DeployParams struct {
	ProjectName string
	RepoOwner   string
	RepoName    string
	EnvVars     []string
}

type DeserializeFunc

type DeserializeFunc func([]byte) (DeployFunc, error)

type DockerCompose

type DockerCompose struct {
	FileLocation string `json:"file_location"`
}

func (*DockerCompose) Deploy

func (*DockerCompose) Deploy(opts *DeployParams) error

func (*DockerCompose) Stop

func (s *DockerCompose) Stop(projectName string) error

type Dockerfile

type Dockerfile struct {
	FileLocation   string     `json:"file_location"`
	HostPorts      string     `json:"host_ports"`
	ContainerPorts string     `json:"container_ports"`
	Volumes        [][]string `json:"volumes"`
	NetworkMode    int        `json:"network_mode"`
	NetworkName    string     `json:"network_name"`
}

func (*Dockerfile) Deploy

func (s *Dockerfile) Deploy(params *DeployParams) error

func (*Dockerfile) Stop

func (s *Dockerfile) Stop(projectName string) error

type ProcessStore

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

func NewProcessStore

func NewProcessStore() *ProcessStore

func (*ProcessStore) Get

func (p *ProcessStore) Get(key string) *os.Process

func (*ProcessStore) Set

func (p *ProcessStore) Set(key string, process *os.Process)

type ProjectDeploymentInfo

type ProjectDeploymentInfo interface {
	Deploy(*DeployParams) error
	Stop(string) error
	// contains filtered or unexported methods
}

func GetProjectDeploymentInfo

func GetProjectDeploymentInfo(projectType db.ProjectType, buf []byte) (ProjectDeploymentInfo, error)

type ShellScript

type ShellScript struct {
	FileLocation string `json:"file_location"`
}

func (*ShellScript) Deploy

func (s *ShellScript) Deploy(params *DeployParams) error

func (*ShellScript) Stop

func (s *ShellScript) Stop(projectName string) error

type SingleCommand

type SingleCommand struct {
	Language string `json:"language"`
	Command  string `json:"command"`
}

func (*SingleCommand) Deploy

func (s *SingleCommand) Deploy(params *DeployParams) error

func (*SingleCommand) Stop

func (s *SingleCommand) Stop(projectName string) error

Jump to

Keyboard shortcuts

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