gitspace

package
v1.0.0-gitspaces-beta Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// errSecretRequiresParent if the user tries to create a secret without a parent space.
	ErrGitspaceRequiresParent = usererror.BadRequest(
		"Parent space required - standalone gitspace are not supported.")
)

WireSet provides a wire set for this package.

Functions

This section is empty.

Types

type ActionInput

type ActionInput struct {
	Action     enum.GitspaceActionType `json:"action"`
	Identifier string                  `json:"-"`
	SpaceRef   string                  `json:"-"` // Ref of the parent space
}

type Controller

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

func NewController

func NewController(
	tx dbtx.Transactor,
	authorizer authz.Authorizer,
	infraProviderSvc *infraprovider.Service,
	gitspaceConfigStore store.GitspaceConfigStore,
	gitspaceInstanceStore store.GitspaceInstanceStore,
	spaceStore store.SpaceStore,
	eventReporter *gitspaceevents.Reporter,
	orchestrator orchestrator.Orchestrator,
	gitspaceEventStore store.GitspaceEventStore,
	statefulLogger *logutil.StatefulLogger,
	scm scm.SCM,
) *Controller

func ProvideController

func ProvideController(
	tx dbtx.Transactor,
	authorizer authz.Authorizer,
	infraProviderSvc *infraprovider.Service,
	configStore store.GitspaceConfigStore,
	instanceStore store.GitspaceInstanceStore,
	spaceStore store.SpaceStore,
	reporter *gitspaceevents.Reporter,
	orchestrator orchestrator.Orchestrator,
	eventStore store.GitspaceEventStore,
	statefulLogger *logutil.StatefulLogger,
	scm scm.SCM,
) *Controller

func (*Controller) Action

func (c *Controller) Action(
	ctx context.Context,
	session *auth.Session,
	in *ActionInput,
) (*types.GitspaceConfig, error)

func (*Controller) Create

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

Create creates a new gitspace.

func (*Controller) Delete

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

func (*Controller) Events

func (c *Controller) Events(
	ctx context.Context,
	session *auth.Session,
	spaceRef string,
	identifier string,
	page int,
	limit int,
) ([]*types.GitspaceEventResponse, int, error)

func (*Controller) Find

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

func (*Controller) ListAllGitspaces

func (c *Controller) ListAllGitspaces(
	ctx context.Context,
	session *auth.Session,
) ([]*types.GitspaceConfig, error)

func (*Controller) LogsStream

func (c *Controller) LogsStream(
	ctx context.Context,
	session *auth.Session,
	spaceRef string,
	identifier string,
) (<-chan *sse.Event, <-chan error, error)

func (*Controller) LookupRepo

func (c *Controller) LookupRepo(
	ctx context.Context,
	session *auth.Session,
	in *LookupRepoInput,
) (*scm.CodeRepositoryResponse, error)

func (*Controller) Update

func (c *Controller) Update(
	ctx context.Context,
	session *auth.Session,
	spaceRef string,
	identifier string,
	in *UpdateInput,
) error

type CreateInput

type CreateInput struct {
	Identifier         string            `json:"identifier"`
	Name               string            `json:"name"`
	SpaceRef           string            `json:"space_ref"` // Ref of the parent space
	IDE                enum.IDEType      `json:"ide"`
	ResourceIdentifier string            `json:"resource_identifier"`
	ResourceSpaceRef   string            `json:"resource_space_ref"`
	CodeRepoURL        string            `json:"code_repo_url"`
	Branch             string            `json:"branch"`
	DevcontainerPath   *string           `json:"devcontainer_path"`
	Metadata           map[string]string `json:"metadata"`
}

CreateInput is the input used for create operations.

type LookupRepoInput

type LookupRepoInput struct {
	Identifier string `json:"-"`
	SpaceRef   string `json:"space_ref"` // Ref of the parent space
	URL        string `json:"url"`
}

type UpdateInput

type UpdateInput struct {
	IDE                enum.IDEType `json:"ide"`
	ResourceIdentifier string       `json:"resource_identifier"`
	Name               string       `json:"name"`
	Identifier         string       `json:"-"`
	SpaceRef           string       `json:"-"`
}

UpdateInput is used for updating a gitspace.

Jump to

Keyboard shortcuts

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