providers

package
v0.0.0-...-e59a564 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildProvider

func BuildProvider(providerRepoPath string, entProvider *ent.Provider) error

func ExecuteProvider

func ExecuteProvider(ctx context.Context, cacheDir string, entProvider *ent.Provider, shutdown chan bool)

Blocking call which executes the given provider and handles shutdown when requested

Types

type CBLEServer

type CBLEServer struct {
	cbleGRPC.DefaultCBLEServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(entClient *ent.Client, providersConfig *config.ProvidersConfig) *CBLEServer

func (*CBLEServer) Configure

func (ps *CBLEServer) Configure(ctx context.Context, entProvider *ent.Provider) (*pgrpc.ConfigureReply, error)

Runs a synchronous GenerateDependencies command

func (*CBLEServer) DeployResource

func (ps *CBLEServer) DeployResource(ctx context.Context, entProvider *ent.Provider, entDeploymentNode *ent.DeploymentNode, templatedObject []byte) (*pgrpc.DeployResourceReply, error)

Runs a synchronous DeployResource command

func (*CBLEServer) DestroyResource

func (ps *CBLEServer) DestroyResource(ctx context.Context, entProvider *ent.Provider, entDeploymentNode *ent.DeploymentNode) (*pgrpc.DestroyResourceReply, error)

Runs a synchronous DestroyResource command

func (*CBLEServer) ExtractResourceMetadata

func (ps *CBLEServer) ExtractResourceMetadata(ctx context.Context, entProvider *ent.Provider, entResources []*ent.Resource) (*pgrpc.ExtractResourceMetadataReply, error)

Runs a synchronous ExtractResourceMetadata command

func (*CBLEServer) GetConsole

func (ps *CBLEServer) GetConsole(ctx context.Context, entProvider *ent.Provider, entDeploymentNode *ent.DeploymentNode) (*pgrpc.GetConsoleReply, error)

Runs a synchronous GetConsole command

func (*CBLEServer) Listen

func (ps *CBLEServer) Listen(ctx context.Context, wg *sync.WaitGroup)

Listens on configured port. Runs in a go routine

func (*CBLEServer) QueueLoadProvider

func (ps *CBLEServer) QueueLoadProvider(id string)

func (*CBLEServer) QueueUnloadProvider

func (ps *CBLEServer) QueueUnloadProvider(id string) error

func (*CBLEServer) RegisterProvider

func (ps *CBLEServer) RegisterProvider(ctx context.Context, request *cbleGRPC.RegistrationRequest) (*cbleGRPC.RegistrationReply, error)

func (*CBLEServer) ResourcePower

func (ps *CBLEServer) ResourcePower(ctx context.Context, entProvider *ent.Provider, entDeploymentNode *ent.DeploymentNode, state pgrpc.PowerState) (*pgrpc.ResourcePowerReply, error)

Runs a synchronous ResourcePower command

func (*CBLEServer) RetrieveData

func (ps *CBLEServer) RetrieveData(ctx context.Context, entProvider *ent.Provider, entDeploymentNode *ent.DeploymentNode, templatedObject []byte) (*pgrpc.RetrieveDataReply, error)

Runs a synchronous RetrieveData command

func (*CBLEServer) RunAllProviders

func (ps *CBLEServer) RunAllProviders(ctx context.Context) error

func (*CBLEServer) RunProviderClients

func (ps *CBLEServer) RunProviderClients(ctx context.Context, wg *sync.WaitGroup)

Runs all provider clients queued to connect. Runs in a go routine

func (*CBLEServer) RunProviderServers

func (ps *CBLEServer) RunProviderServers(ctx context.Context, wg *sync.WaitGroup)

Runs all provider servers queued to start. Runs in a go routine

func (*CBLEServer) UnregisterProvider

func (ps *CBLEServer) UnregisterProvider(ctx context.Context, request *cbleGRPC.UnregistrationRequest) (*cbleGRPC.UnregistrationReply, error)

type DockerErrorDetail

type DockerErrorDetail struct {
	Message string `json:"message"`
}

type DockerErrorLine

type DockerErrorLine struct {
	Error       string            `json:"error"`
	ErrorDetail DockerErrorDetail `json:"errorDetail"`
}

type DockerMetadata

type DockerMetadata struct {
	Dockerfile string `yaml:"dockerfile"`
	Command    string `yaml:"cmd"`
}

type ProviderMetadata

type ProviderMetadata struct {
	Name        string          `yaml:"name"`
	Description string          `yaml:"description"`
	Author      string          `yaml:"author"`
	Version     string          `yaml:"version"`
	Type        ProviderType    `yaml:"type"`
	DockerMeta  *DockerMetadata `yaml:"docker,omitempty"`
	ShellMeta   *ShellMetadata  `yaml:"shell,omitempty"`
}

func ParseMetadata

func ParseMetadata(providerRepoPath string) (*ProviderMetadata, error)

type ProviderType

type ProviderType string
const (
	TypeDocker ProviderType = "docker"
	TypeShell  ProviderType = "shell"
)

type RegisteredProvider

type RegisteredProvider struct {
	ID       string
	SocketID string
	Features *cbleGRPC.ProviderFeatures
}

type ShellMetadata

type ShellMetadata struct {
	PrebuildCommand string `yaml:"prebuild_cmd"`
	BuildCommand    string `yaml:"build_cmd"`
	ExecCommand     string `yaml:"exec_cmd"`
}

Jump to

Keyboard shortcuts

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