infraprovider

package
v0.0.0-...-4c964c4 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const NoResourceIdentifier = ""

Variables

WireSet provides a wire set for this package.

Functions

This section is empty.

Types

type Controller

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

func NewController

func NewController(
	authorizer authz.Authorizer,
	spaceStore store.SpaceStore,
	infraproviderSvc *infraprovider.Service,
) *Controller

func ProvideController

func ProvideController(
	authorizer authz.Authorizer,
	spaceStore store.SpaceStore,
	infraproviderSvc *infraprovider.Service,
) *Controller

func (*Controller) Create

func (c *Controller) Create(
	ctx context.Context,
	session auth.Session,
	in CreateInput,
) (*types.InfraProviderConfig, error)

Create creates a new infra provider.

func (*Controller) CreateResources

func (c *Controller) CreateResources(
	ctx context.Context,
	session auth.Session,
	in []ResourceInput,
	configIdentifier string,
	spaceRef string,
) ([]types.InfraProviderResource, error)

func (*Controller) CreateTemplate

func (c *Controller) CreateTemplate(
	ctx context.Context,
	session *auth.Session,
	in *TemplateInput,
	configIdentifier string,
	spaceRef string,
) (*types.InfraProviderTemplate, error)

func (*Controller) Find

func (c *Controller) Find(
	ctx context.Context,
	session *auth.Session,
	spaceRef string,
	identifier string,
) (*types.InfraProviderConfig, error)

func (*Controller) MapToInfraProviderConfig

func (c *Controller) MapToInfraProviderConfig(
	in CreateInput,
	parentSpace *types.Space,
	now int64,
) *types.InfraProviderConfig

type CreateInput

type CreateInput struct {
	Identifier string                 `json:"identifier" yaml:"identifier"`
	SpaceRef   string                 `json:"space_ref" yaml:"space_ref"` // Ref of the parent space
	Name       string                 `json:"name" yaml:"name"`
	Type       enum.InfraProviderType `json:"type" yaml:"type"`
	Metadata   map[string]string      `json:"metadata" yaml:"metadata"`
	Resources  []ResourceInput        `json:"resources" yaml:"resources"`
}

type ResourceInput

type ResourceInput struct {
	Identifier         string                 `json:"identifier" yaml:"identifier"`
	Name               string                 `json:"name" yaml:"name"`
	InfraProviderType  enum.InfraProviderType `json:"infra_provider_type" yaml:"infra_provider_type"`
	CPU                *string                `json:"cpu" yaml:"cpu"`
	Memory             *string                `json:"memory" yaml:"memory"`
	Disk               *string                `json:"disk" yaml:"disk"`
	Network            *string                `json:"network" yaml:"network"`
	Region             []string               `json:"region" yaml:"region"`
	Metadata           map[string]string      `json:"metadata" yaml:"metadata"`
	GatewayHost        *string                `json:"gateway_host" yaml:"gateway_host"`
	GatewayPort        *string                `json:"gateway_port" yaml:"gateway_port"`
	TemplateIdentifier *string                `json:"template_identifier" yaml:"template_identifier"`
}

type TemplateInput

type TemplateInput struct {
	Identifier  string `json:"identifier" yaml:"identifier"`
	Description string `json:"description" yaml:"description"`
	Data        string `json:"data" yaml:"data"`
}

Jump to

Keyboard shortcuts

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