Documentation
¶
Index ¶
- Variables
- type Controller
- func (c *Controller) Create(ctx context.Context, session *auth.Session, in *CreateInput) (*SpaceOutput, error)
- func (c *Controller) DefineLabel(ctx context.Context, session *auth.Session, spaceRef string, ...) (*types.Label, error)
- func (c *Controller) DefineLabelValue(ctx context.Context, session *auth.Session, spaceRef string, key string, ...) (*types.LabelValue, error)
- func (c *Controller) DeleteLabel(ctx context.Context, session *auth.Session, spaceRef string, key string) error
- func (c *Controller) DeleteLabelValue(ctx context.Context, session *auth.Session, spaceRef string, key string, ...) error
- func (c *Controller) Events(ctx context.Context, session *auth.Session, spaceRef string) (<-chan *sse.Event, <-chan error, func(context.Context) error, error)
- func (c *Controller) Export(ctx context.Context, session *auth.Session, spaceRef string, in *ExportInput) error
- func (c *Controller) ExportProgress(ctx context.Context, session *auth.Session, spaceRef string) (ExportProgressOutput, error)
- func (c *Controller) Find(ctx context.Context, session *auth.Session, spaceRef string) (*SpaceOutput, error)
- func (c *Controller) Import(ctx context.Context, session *auth.Session, in *ImportInput) (*SpaceOutput, error)
- func (c *Controller) ImportRepositories(ctx context.Context, session *auth.Session, spaceRef string, ...) (ImportRepositoriesOutput, error)
- func (c *Controller) ListConnectors(ctx context.Context, session *auth.Session, spaceRef string, ...) ([]*types.Connector, int64, error)
- func (c *Controller) ListGitspaces(ctx context.Context, session *auth.Session, spaceRef string, ...) ([]*types.GitspaceConfig, int64, error)
- func (c *Controller) ListLabelValues(ctx context.Context, session *auth.Session, spaceRef string, key string, ...) ([]*types.LabelValue, error)
- func (c *Controller) ListLabels(ctx context.Context, session *auth.Session, spaceRef string, ...) ([]*types.Label, int64, error)
- func (c *Controller) ListRepositories(ctx context.Context, session *auth.Session, spaceRef string, ...) ([]*repoCtrl.RepositoryOutput, int64, error)
- func (c *Controller) ListRepositoriesNoAuth(ctx context.Context, spaceID int64, filter *types.RepoFilter) ([]*repoCtrl.RepositoryOutput, int64, error)
- func (c *Controller) ListSecrets(ctx context.Context, session *auth.Session, spaceRef string, ...) ([]*types.Secret, int64, error)
- func (c *Controller) ListServiceAccounts(ctx context.Context, session *auth.Session, spaceRef string) ([]*types.ServiceAccount, error)
- func (c *Controller) ListSpaces(ctx context.Context, session *auth.Session, spaceRef string, ...) ([]*SpaceOutput, int64, error)
- func (c *Controller) ListSpacesNoAuth(ctx context.Context, spaceID int64, filter *types.SpaceFilter) ([]*SpaceOutput, int64, error)
- func (c *Controller) ListTemplates(ctx context.Context, session *auth.Session, spaceRef string, ...) ([]*types.Template, int64, error)
- func (c *Controller) MembershipAdd(ctx context.Context, session *auth.Session, spaceRef string, ...) (*types.MembershipUser, error)
- func (c *Controller) MembershipDelete(ctx context.Context, session *auth.Session, spaceRef string, userUID string) error
- func (c *Controller) MembershipList(ctx context.Context, session *auth.Session, spaceRef string, ...) ([]types.MembershipUser, int64, error)
- func (c *Controller) MembershipUpdate(ctx context.Context, session *auth.Session, spaceRef string, userUID string, ...) (*types.MembershipUser, error)
- func (c *Controller) Move(ctx context.Context, session *auth.Session, spaceRef string, in *MoveInput) (*SpaceOutput, error)
- func (c *Controller) Purge(ctx context.Context, session *auth.Session, spaceRef string, deletedAt int64) error
- func (c *Controller) PurgeNoAuth(ctx context.Context, session *auth.Session, space *types.Space) error
- func (c *Controller) Restore(ctx context.Context, session *auth.Session, spaceRef string, deletedAt int64, ...) (*SpaceOutput, error)
- func (c *Controller) SaveLabel(ctx context.Context, session *auth.Session, spaceRef string, ...) (*types.LabelWithValues, error)
- func (c *Controller) SoftDelete(ctx context.Context, session *auth.Session, spaceRef string) (*SoftDeleteResponse, error)
- func (c *Controller) SoftDeleteNoAuth(ctx context.Context, session *auth.Session, space *types.Space) (*SoftDeleteResponse, error)
- func (c *Controller) Update(ctx context.Context, session *auth.Session, spaceRef string, in *UpdateInput) (*SpaceOutput, error)
- func (c *Controller) UpdateLabel(ctx context.Context, session *auth.Session, spaceRef string, key string, ...) (*types.Label, error)
- func (c *Controller) UpdateLabelValue(ctx context.Context, session *auth.Session, spaceRef string, key string, ...) (*types.LabelValue, error)
- func (c *Controller) UpdatePublicAccess(ctx context.Context, session *auth.Session, spaceRef string, ...) (*SpaceOutput, error)
- type CreateInput
- type ExportInput
- type ExportProgressOutput
- type ImportInput
- type ImportRepositoriesInput
- type ImportRepositoriesOutput
- type MembershipAddInput
- type MembershipUpdateInput
- type MoveInput
- type ProviderInput
- type RestoreInput
- type SoftDeleteResponse
- type SpaceOutput
- type UpdateInput
- type UpdatePublicAccessInput
Constants ¶
This section is empty.
Variables ¶
var WireSet = wire.NewSet( ProvideController, )
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(config *types.Config, tx dbtx.Transactor, urlProvider url.Provider, sseStreamer sse.Streamer, identifierCheck check.SpaceIdentifier, authorizer authz.Authorizer, spacePathStore store.SpacePathStore, pipelineStore store.PipelineStore, secretStore store.SecretStore, connectorStore store.ConnectorStore, templateStore store.TemplateStore, spaceStore store.SpaceStore, repoStore store.RepoStore, principalStore store.PrincipalStore, repoCtrl *repo.Controller, membershipStore store.MembershipStore, importer *importer.Repository, exporter *exporter.Repository, limiter limiter.ResourceLimiter, publicAccess publicaccess.Service, auditService audit.Service, gitspaceSvc *gitspace.Service, gitspaceStore store.GitspaceConfigStore, gitspaceInstanceStore store.GitspaceInstanceStore, labelSvc *label.Service, ) *Controller
func ProvideController ¶
func ProvideController(config *types.Config, tx dbtx.Transactor, urlProvider url.Provider, sseStreamer sse.Streamer, identifierCheck check.SpaceIdentifier, authorizer authz.Authorizer, spacePathStore store.SpacePathStore, pipelineStore store.PipelineStore, secretStore store.SecretStore, connectorStore store.ConnectorStore, templateStore store.TemplateStore, spaceStore store.SpaceStore, repoStore store.RepoStore, principalStore store.PrincipalStore, repoCtrl *repo.Controller, membershipStore store.MembershipStore, importer *importer.Repository, exporter *exporter.Repository, limiter limiter.ResourceLimiter, publicAccess publicaccess.Service, auditService audit.Service, gitspaceService *gitspace.Service, gitspaceConfigStore store.GitspaceConfigStore, instanceStore store.GitspaceInstanceStore, labelSvc *label.Service, ) *Controller
func (*Controller) Create ¶
func (c *Controller) Create( ctx context.Context, session *auth.Session, in *CreateInput, ) (*SpaceOutput, error)
Create creates a new space.
func (*Controller) DefineLabel ¶
func (c *Controller) DefineLabel( ctx context.Context, session *auth.Session, spaceRef string, in *types.DefineLabelInput, ) (*types.Label, error)
DefineLabel defines a new label for the specified space.
func (*Controller) DefineLabelValue ¶
func (c *Controller) DefineLabelValue( ctx context.Context, session *auth.Session, spaceRef string, key string, in *types.DefineValueInput, ) (*types.LabelValue, error)
DefineLabelValue defines a new label value for the specified space and label.
func (*Controller) DeleteLabel ¶
func (c *Controller) DeleteLabel( ctx context.Context, session *auth.Session, spaceRef string, key string, ) error
DeleteLabel deletes a label for the specified space.
func (*Controller) DeleteLabelValue ¶
func (c *Controller) DeleteLabelValue( ctx context.Context, session *auth.Session, spaceRef string, key string, value string, ) error
DeleteLabelValue deletes a label value for the specified space.
func (*Controller) Export ¶
func (c *Controller) Export(ctx context.Context, session *auth.Session, spaceRef string, in *ExportInput) error
Export creates a new empty repository in harness code and does git push to it.
func (*Controller) ExportProgress ¶
func (c *Controller) ExportProgress(ctx context.Context, session *auth.Session, spaceRef string, ) (ExportProgressOutput, error)
ExportProgress returns progress of the export job.
func (*Controller) Find ¶
func (c *Controller) Find(ctx context.Context, session *auth.Session, spaceRef string) (*SpaceOutput, error)
* Find finds a space.
func (*Controller) Import ¶
func (c *Controller) Import(ctx context.Context, session *auth.Session, in *ImportInput) (*SpaceOutput, error)
Import creates new space and starts import of all repositories from the remote provider's space into it.
func (*Controller) ImportRepositories ¶
func (c *Controller) ImportRepositories( ctx context.Context, session *auth.Session, spaceRef string, in *ImportRepositoriesInput, ) (ImportRepositoriesOutput, error)
ImportRepositories imports repositories into an existing space. It ignores and continues on repo naming conflicts.
func (*Controller) ListConnectors ¶
func (c *Controller) ListConnectors( ctx context.Context, session *auth.Session, spaceRef string, filter types.ListQueryFilter, ) ([]*types.Connector, int64, error)
ListConnectors lists the connectors in a space.
func (*Controller) ListGitspaces ¶
func (c *Controller) ListGitspaces( ctx context.Context, session *auth.Session, spaceRef string, filter types.ListQueryFilter, ) ([]*types.GitspaceConfig, int64, error)
func (*Controller) ListLabelValues ¶
func (c *Controller) ListLabelValues( ctx context.Context, session *auth.Session, spaceRef string, key string, filter *types.ListQueryFilter, ) ([]*types.LabelValue, error)
ListLabelValues lists all label values defined in the specified space.
func (*Controller) ListLabels ¶
func (c *Controller) ListLabels( ctx context.Context, session *auth.Session, spaceRef string, filter *types.LabelFilter, ) ([]*types.Label, int64, error)
ListLabels lists all labels defined for the specified space.
func (*Controller) ListRepositories ¶
func (c *Controller) ListRepositories( ctx context.Context, session *auth.Session, spaceRef string, filter *types.RepoFilter, ) ([]*repoCtrl.RepositoryOutput, int64, error)
ListRepositories lists the repositories of a space.
func (*Controller) ListRepositoriesNoAuth ¶
func (c *Controller) ListRepositoriesNoAuth( ctx context.Context, spaceID int64, filter *types.RepoFilter, ) ([]*repoCtrl.RepositoryOutput, int64, error)
ListRepositoriesNoAuth list repositories WITHOUT checking for PermissionRepoView.
func (*Controller) ListSecrets ¶
func (c *Controller) ListSecrets( ctx context.Context, session *auth.Session, spaceRef string, filter types.ListQueryFilter, ) ([]*types.Secret, int64, error)
ListSecrets lists the secrets in a space.
func (*Controller) ListServiceAccounts ¶
func (c *Controller) ListServiceAccounts(ctx context.Context, session *auth.Session, spaceRef string) ([]*types.ServiceAccount, error)
* ListServiceAccounts lists the service accounts of a space.
func (*Controller) ListSpaces ¶
func (c *Controller) ListSpaces(ctx context.Context, session *auth.Session, spaceRef string, filter *types.SpaceFilter, ) ([]*SpaceOutput, int64, error)
ListSpaces lists the child spaces of a space.
func (*Controller) ListSpacesNoAuth ¶
func (c *Controller) ListSpacesNoAuth( ctx context.Context, spaceID int64, filter *types.SpaceFilter, ) ([]*SpaceOutput, int64, error)
ListSpacesNoAuth lists spaces WITHOUT checking PermissionSpaceView.
func (*Controller) ListTemplates ¶
func (c *Controller) ListTemplates( ctx context.Context, session *auth.Session, spaceRef string, filter types.ListQueryFilter, ) ([]*types.Template, int64, error)
ListTemplates lists the templates in a space.
func (*Controller) MembershipAdd ¶
func (c *Controller) MembershipAdd(ctx context.Context, session *auth.Session, spaceRef string, in *MembershipAddInput, ) (*types.MembershipUser, error)
MembershipAdd adds a new membership to a space.
func (*Controller) MembershipDelete ¶
func (c *Controller) MembershipDelete(ctx context.Context, session *auth.Session, spaceRef string, userUID string, ) error
MembershipDelete removes an existing membership from a space.
func (*Controller) MembershipList ¶
func (c *Controller) MembershipList(ctx context.Context, session *auth.Session, spaceRef string, filter types.MembershipUserFilter, ) ([]types.MembershipUser, int64, error)
MembershipList lists all space memberships.
func (*Controller) MembershipUpdate ¶
func (c *Controller) MembershipUpdate(ctx context.Context, session *auth.Session, spaceRef string, userUID string, in *MembershipUpdateInput, ) (*types.MembershipUser, error)
MembershipUpdate changes the role of an existing membership.
func (*Controller) Move ¶
func (c *Controller) Move( ctx context.Context, session *auth.Session, spaceRef string, in *MoveInput, ) (*SpaceOutput, error)
Move moves a space to a new identifier. TODO: Add support for moving to other parents and alias.
func (*Controller) Purge ¶
func (c *Controller) Purge( ctx context.Context, session *auth.Session, spaceRef string, deletedAt int64, ) error
Purge deletes the space and all its subspaces and repositories permanently.
func (*Controller) PurgeNoAuth ¶
func (c *Controller) PurgeNoAuth( ctx context.Context, session *auth.Session, space *types.Space, ) error
PurgeNoAuth purges the space - no authorization is verified. WARNING For internal calls only.
func (*Controller) Restore ¶
func (c *Controller) Restore( ctx context.Context, session *auth.Session, spaceRef string, deletedAt int64, in *RestoreInput, ) (*SpaceOutput, error)
func (*Controller) SaveLabel ¶
func (c *Controller) SaveLabel( ctx context.Context, session *auth.Session, spaceRef string, in *types.SaveInput, ) (*types.LabelWithValues, error)
SaveLabel defines a new label for the specified space.
func (*Controller) SoftDelete ¶
func (c *Controller) SoftDelete( ctx context.Context, session *auth.Session, spaceRef string, ) (*SoftDeleteResponse, error)
SoftDelete marks deleted timestamp for the space and all its subspaces and repositories inside.
func (*Controller) SoftDeleteNoAuth ¶
func (c *Controller) SoftDeleteNoAuth( ctx context.Context, session *auth.Session, space *types.Space, ) (*SoftDeleteResponse, error)
SoftDeleteNoAuth soft deletes the space - no authorization is verified. WARNING For internal calls only.
func (*Controller) Update ¶
func (c *Controller) Update( ctx context.Context, session *auth.Session, spaceRef string, in *UpdateInput, ) (*SpaceOutput, error)
Update updates a space.
func (*Controller) UpdateLabel ¶
func (c *Controller) UpdateLabel( ctx context.Context, session *auth.Session, spaceRef string, key string, in *types.UpdateLabelInput, ) (*types.Label, error)
UpdateLabel updates a label for the specified space.
func (*Controller) UpdateLabelValue ¶
func (c *Controller) UpdateLabelValue( ctx context.Context, session *auth.Session, spaceRef string, key string, value string, in *types.UpdateValueInput, ) (*types.LabelValue, error)
UpdateLabelValue updates a label value for the specified space and label.
func (*Controller) UpdatePublicAccess ¶
func (c *Controller) UpdatePublicAccess(ctx context.Context, session *auth.Session, spaceRef string, in *UpdatePublicAccessInput, ) (*SpaceOutput, error)
type CreateInput ¶
type ExportInput ¶
type ExportProgressOutput ¶
type ImportInput ¶
type ImportInput struct { CreateInput ProviderInput }
type ImportRepositoriesInput ¶
type ImportRepositoriesInput struct {
ProviderInput
}
type ImportRepositoriesOutput ¶
type ImportRepositoriesOutput struct { ImportingRepos []*repoctrl.RepositoryOutput `json:"importing_repos"` DuplicateRepos []*repoctrl.RepositoryOutput `json:"duplicate_repos"` // repos which already exist in the space. }
type MembershipAddInput ¶
type MembershipAddInput struct { UserUID string `json:"user_uid"` Role enum.MembershipRole `json:"role"` }
func (*MembershipAddInput) Validate ¶
func (in *MembershipAddInput) Validate() error
type MembershipUpdateInput ¶
type MembershipUpdateInput struct {
Role enum.MembershipRole `json:"role"`
}
func (*MembershipUpdateInput) Validate ¶
func (in *MembershipUpdateInput) Validate() error
type MoveInput ¶
type MoveInput struct { // TODO [CODE-1363]: remove after identifier migration. UID *string `json:"uid" deprecated:"true"` Identifier *string `json:"identifier"` }
MoveInput is used for moving a space.
type ProviderInput ¶
type ProviderInput struct { Provider importer.Provider `json:"provider"` ProviderSpace string `json:"provider_space"` Pipelines importer.PipelineOption `json:"pipelines"` }
type RestoreInput ¶
type SoftDeleteResponse ¶
type SoftDeleteResponse struct {
DeletedAt int64 `json:"deleted_at"`
}
type SpaceOutput ¶
func GetSpaceOutput ¶
func GetSpaceOutput( ctx context.Context, publicAccess publicaccess.Service, space *types.Space, ) (*SpaceOutput, error)
func (SpaceOutput) MarshalJSON ¶
func (s SpaceOutput) MarshalJSON() ([]byte, error)
TODO [CODE-1363]: remove after identifier migration.
type UpdateInput ¶
type UpdateInput struct {
Description *string `json:"description"`
}
UpdateInput is used for updating a space.
type UpdatePublicAccessInput ¶
type UpdatePublicAccessInput struct {
IsPublic bool `json:"is_public"`
}
Source Files
¶
- controller.go
- create.go
- events.go
- export.go
- export_progress.go
- find.go
- helper.go
- import.go
- import_repositories.go
- label_define.go
- label_delete.go
- label_list.go
- label_save.go
- label_update.go
- label_value_define.go
- label_value_delete.go
- label_value_list.go
- label_value_update.go
- list_connectors.go
- list_gitspaces.go
- list_repositories.go
- list_secrets.go
- list_service_accounts.go
- list_spaces.go
- list_templates.go
- membership_add.go
- membership_delete.go
- membership_list.go
- membership_update.go
- move.go
- purge.go
- restore.go
- soft_delete.go
- update.go
- update_public_access.go
- wire.go