plugin

package
v0.0.0-...-0d3f7f9 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	VirtenvPath    = filepath.Join(devboxHiddenDirName, "virtenv")
	VirtenvBinPath = filepath.Join(VirtenvPath, "bin")
)

Functions

func GetServices

func GetServices(configs []*Config) (services.Services, error)

func Readme

func Readme(ctx context.Context,
	pkg *devpkg.Package,
	projectDir string,
	markdown bool,
) (string, error)

func Remove

func Remove(projectDir string, pkgs []string) error
func RemoveInvalidSymlinks(projectDir string) error

func Update

func Update() error

func WithDevbox

func WithDevbox(provider devboxProject) managerOption

func WithLockfile

func WithLockfile(lockfile *lock.File) managerOption

Types

type Config

type Config struct {
	configfile.ConfigFile
	PluginOnlyData
}

func GetBuiltinsForPackages

func GetBuiltinsForPackages(
	packages []configfile.Package,
	lockfile *lock.File,
) ([]*Config, error)

func LoadConfigFromInclude

func LoadConfigFromInclude(include string, lockfile *lock.File, workingDir string) (*Config, error)

func (*Config) Description

func (c *Config) Description() string

func (*Config) ProcessComposeYaml

func (c *Config) ProcessComposeYaml() (string, string)

func (*Config) Services

func (c *Config) Services() (services.Services, error)

type Includable

type Includable interface {
	CanonicalName() string
	FileContent(subpath string) ([]byte, error)
	Hash() string
	LockfileKey() string
}

type LocalPlugin

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

func (*LocalPlugin) CanonicalName

func (l *LocalPlugin) CanonicalName() string

func (*LocalPlugin) Fetch

func (l *LocalPlugin) Fetch() ([]byte, error)

func (*LocalPlugin) FileContent

func (l *LocalPlugin) FileContent(subpath string) ([]byte, error)

func (*LocalPlugin) Hash

func (l *LocalPlugin) Hash() string

func (*LocalPlugin) IsLocal

func (l *LocalPlugin) IsLocal() bool

func (*LocalPlugin) LockfileKey

func (l *LocalPlugin) LockfileKey() string

func (*LocalPlugin) Path

func (l *LocalPlugin) Path() string

type Manager

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

func NewManager

func NewManager(opts ...managerOption) *Manager

func (*Manager) ApplyOptions

func (m *Manager) ApplyOptions(opts ...managerOption)

func (*Manager) CreateFilesForConfig

func (m *Manager) CreateFilesForConfig(cfg *Config) error

type PluginOnlyData

type PluginOnlyData struct {
	CreateFiles           map[string]string `json:"create_files"`
	DeprecatedDescription string            `json:"readme"`
	// If true, we remove the package that triggered this plugin from the environment
	// Useful when we want to replace with flake
	RemoveTriggerPackage bool   `json:"__remove_trigger_package,omitempty"`
	Version              string `json:"version"`
	// Source is the includable that triggered this plugin. There are two ways to include a plugin:
	// 1. Built-in plugins are triggered by packages (See plugins.builtInMap)
	// 2. Plugins can be added via the "include" field in devbox.json or plugin.json
	Source Includable
}

Jump to

Keyboard shortcuts

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