provider

package
v0.44.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 8 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTargetNotFound = errors.New("target not found")
)

Functions

func IsTargetNotFound added in v0.18.0

func IsTargetNotFound(err error) bool

Types

type InitializeProviderRequest

type InitializeProviderRequest struct {
	BasePath           string
	DaytonaDownloadUrl string
	DaytonaVersion     string
	LogsDir            string

	NetworkKey string
	ServerUrl  string
	ApiUrl     string
	// ServerPort is used if the target supports direct server access
	ServerPort uint32
	// ApiPort is used if the target supports direct server access
	ApiPort uint32
}

type ProjectRequest

type ProjectRequest struct {
	TargetOptions     string
	ContainerRegistry *containerregistry.ContainerRegistry
	Project           *project.Project
	GitProviderConfig *gitprovider.GitProviderConfig
}

type Provider

type Provider interface {
	Initialize(InitializeProviderRequest) (*util.Empty, error)
	GetInfo() (ProviderInfo, error)

	GetTargetManifest() (*ProviderTargetManifest, error)
	GetPresetTargets() (*[]ProviderTarget, error)

	CreateWorkspace(*WorkspaceRequest) (*util.Empty, error)
	StartWorkspace(*WorkspaceRequest) (*util.Empty, error)
	StopWorkspace(*WorkspaceRequest) (*util.Empty, error)
	DestroyWorkspace(*WorkspaceRequest) (*util.Empty, error)
	GetWorkspaceInfo(*WorkspaceRequest) (*workspace.WorkspaceInfo, error)

	CreateProject(*ProjectRequest) (*util.Empty, error)
	StartProject(*ProjectRequest) (*util.Empty, error)
	StopProject(*ProjectRequest) (*util.Empty, error)
	DestroyProject(*ProjectRequest) (*util.Empty, error)
	GetProjectInfo(*ProjectRequest) (*project.ProjectInfo, error)
}

type ProviderInfo

type ProviderInfo struct {
	Name    string  `json:"name" validate:"required"`
	Label   *string `json:"label" validate:"optional"`
	Version string  `json:"version" validate:"required"`
}

type ProviderPlugin

type ProviderPlugin struct {
	Impl Provider
}

func (*ProviderPlugin) Client

func (p *ProviderPlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (*ProviderPlugin) Server

func (p *ProviderPlugin) Server(*plugin.MuxBroker) (interface{}, error)

type ProviderRPCClient

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

func (*ProviderRPCClient) CreateProject

func (m *ProviderRPCClient) CreateProject(projectReq *ProjectRequest) (*util.Empty, error)

func (*ProviderRPCClient) CreateWorkspace

func (m *ProviderRPCClient) CreateWorkspace(workspaceReq *WorkspaceRequest) (*util.Empty, error)

func (*ProviderRPCClient) DestroyProject

func (m *ProviderRPCClient) DestroyProject(projectReq *ProjectRequest) (*util.Empty, error)

func (*ProviderRPCClient) DestroyWorkspace

func (m *ProviderRPCClient) DestroyWorkspace(workspaceReq *WorkspaceRequest) (*util.Empty, error)

func (*ProviderRPCClient) GetInfo

func (m *ProviderRPCClient) GetInfo() (ProviderInfo, error)

func (*ProviderRPCClient) GetPresetTargets added in v0.40.0

func (m *ProviderRPCClient) GetPresetTargets() (*[]ProviderTarget, error)

func (*ProviderRPCClient) GetProjectInfo

func (m *ProviderRPCClient) GetProjectInfo(projectReq *ProjectRequest) (*project.ProjectInfo, error)

func (*ProviderRPCClient) GetTargetManifest

func (m *ProviderRPCClient) GetTargetManifest() (*ProviderTargetManifest, error)

func (*ProviderRPCClient) GetWorkspaceInfo

func (m *ProviderRPCClient) GetWorkspaceInfo(workspaceReq *WorkspaceRequest) (*workspace.WorkspaceInfo, error)

func (*ProviderRPCClient) Initialize

func (*ProviderRPCClient) StartProject

func (m *ProviderRPCClient) StartProject(projectReq *ProjectRequest) (*util.Empty, error)

func (*ProviderRPCClient) StartWorkspace

func (m *ProviderRPCClient) StartWorkspace(workspaceReq *WorkspaceRequest) (*util.Empty, error)

func (*ProviderRPCClient) StopProject

func (m *ProviderRPCClient) StopProject(projectReq *ProjectRequest) (*util.Empty, error)

func (*ProviderRPCClient) StopWorkspace

func (m *ProviderRPCClient) StopWorkspace(workspaceReq *WorkspaceRequest) (*util.Empty, error)

type ProviderRPCServer

type ProviderRPCServer struct {
	Impl Provider
}

func (*ProviderRPCServer) CreateProject

func (m *ProviderRPCServer) CreateProject(arg *ProjectRequest, resp *util.Empty) error

func (*ProviderRPCServer) CreateWorkspace

func (m *ProviderRPCServer) CreateWorkspace(arg *WorkspaceRequest, resp *util.Empty) error

func (*ProviderRPCServer) DestroyProject

func (m *ProviderRPCServer) DestroyProject(arg *ProjectRequest, resp *util.Empty) error

func (*ProviderRPCServer) DestroyWorkspace

func (m *ProviderRPCServer) DestroyWorkspace(arg *WorkspaceRequest, resp *util.Empty) error

func (*ProviderRPCServer) GetInfo

func (m *ProviderRPCServer) GetInfo(arg interface{}, resp *ProviderInfo) error

func (*ProviderRPCServer) GetPresetTargets added in v0.40.0

func (m *ProviderRPCServer) GetPresetTargets(arg interface{}, resp *[]ProviderTarget) error

func (*ProviderRPCServer) GetProjectInfo

func (m *ProviderRPCServer) GetProjectInfo(arg *ProjectRequest, resp *project.ProjectInfo) error

func (*ProviderRPCServer) GetTargetManifest

func (m *ProviderRPCServer) GetTargetManifest(arg interface{}, resp *ProviderTargetManifest) error

func (*ProviderRPCServer) GetWorkspaceInfo

func (m *ProviderRPCServer) GetWorkspaceInfo(arg *WorkspaceRequest, resp *workspace.WorkspaceInfo) error

func (*ProviderRPCServer) Initialize

func (m *ProviderRPCServer) Initialize(arg InitializeProviderRequest, resp *util.Empty) error

func (*ProviderRPCServer) StartProject

func (m *ProviderRPCServer) StartProject(arg *ProjectRequest, resp *util.Empty) error

func (*ProviderRPCServer) StartWorkspace

func (m *ProviderRPCServer) StartWorkspace(arg *WorkspaceRequest, resp *util.Empty) error

func (*ProviderRPCServer) StopProject

func (m *ProviderRPCServer) StopProject(arg *ProjectRequest, resp *util.Empty) error

func (*ProviderRPCServer) StopWorkspace

func (m *ProviderRPCServer) StopWorkspace(arg *WorkspaceRequest, resp *util.Empty) error

type ProviderTarget

type ProviderTarget struct {
	Name         string       `json:"name" validate:"required"`
	ProviderInfo ProviderInfo `json:"providerInfo" validate:"required"`
	// JSON encoded map of options
	Options   string `json:"options" validate:"required"`
	IsDefault bool   `json:"isDefault" validate:"required"`

} // @name ProviderTarget

type ProviderTargetManifest

type ProviderTargetManifest map[string]ProviderTargetProperty // @name ProviderTargetManifest

type ProviderTargetProperty

type ProviderTargetProperty struct {
	Type        ProviderTargetPropertyType
	InputMasked bool
	// A regex string matched with the name of the target to determine if the property should be disabled
	// If the regex matches the target name, the property will be disabled
	// E.g. "^local$" will disable the property for the local target
	DisabledPredicate string
	// DefaultValue is converted into the appropriate type based on the Type
	// If the property is a FilePath, the DefaultValue is a path to a directory
	DefaultValue string
	// Brief description of the property
	Description string
	// Options is only used if the Type is ProviderTargetPropertyTypeOption
	Options []string
	// Suggestions is an optional list of auto-complete values to assist the user while filling the field
	Suggestions []string
}

type ProviderTargetPropertyType

type ProviderTargetPropertyType string
const (
	ProviderTargetPropertyTypeString   ProviderTargetPropertyType = "string"
	ProviderTargetPropertyTypeOption   ProviderTargetPropertyType = "option"
	ProviderTargetPropertyTypeBoolean  ProviderTargetPropertyType = "boolean"
	ProviderTargetPropertyTypeInt      ProviderTargetPropertyType = "int"
	ProviderTargetPropertyTypeFloat    ProviderTargetPropertyType = "float"
	ProviderTargetPropertyTypeFilePath ProviderTargetPropertyType = "file-path"
)

type TargetFilter added in v0.40.0

type TargetFilter struct {
	Name    *string
	Default *bool
}

type TargetStore added in v0.11.0

type TargetStore interface {
	List(filter *TargetFilter) ([]*ProviderTarget, error)
	Find(filter *TargetFilter) (*ProviderTarget, error)
	Save(target *ProviderTarget) error
	Delete(target *ProviderTarget) error
}

type WorkspaceRequest

type WorkspaceRequest struct {
	TargetOptions string
	Workspace     *workspace.Workspace
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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