gitspace

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: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidURL = usererror.BadRequest(
		"The URL specified is not valid format.")
	ErrRepoMissing = usererror.BadRequest(
		"There must be URL or Ref specified fir repo.")
	ErrBadURLScheme = usererror.BadRequest("the URL is missing scheme, it must start with http or https")
)
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,
	repoStore store.RepoStore,
	gitspaceSvc *gitspace.Service,
) *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,
	repoStore store.RepoStore,
	gitspaceSvc *gitspace.Service,
) *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"`
	CodeRepoType       enum.GitspaceCodeRepoType `json:"code_repo_type"`
	CodeRepoRef        *string                   `json:"code_repo_ref"`
	Branch             string                    `json:"branch"`
	DevcontainerPath   *string                   `json:"devcontainer_path"`
	Metadata           map[string]string         `json:"metadata"`
	SSHTokenIdentifier string                    `json:"ssh_token_identifier"`
}

CreateInput is the input used for create operations.

type LookupRepoInput

type LookupRepoInput struct {
	SpaceRef string                    `json:"space_ref"` // Ref of the parent space
	URL      string                    `json:"url"`
	RepoType enum.GitspaceCodeRepoType `json:"repo_type"`
}

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