Documentation
¶
Index ¶
- Constants
- Variables
- func NewHomeHandler(agentSvc agents.AgentService) *homeHandler
- func NewMockProjectDao() *projectDaoMock
- func NewProjectGRPCHandler(service ProjectService, generic services.GenericService, ...) pb.ProjectServiceServer
- func NewProjectHandler(project ProjectService, generic services.GenericService) *projectHandler
- func PresentProject(project *Project) openapi.Project
- func ValidateProjectName(name string) *errors.ServiceError
- type Project
- type ProjectDao
- type ProjectIndex
- type ProjectList
- type ProjectPatchRequest
- type ProjectService
- type ServiceLocator
Constants ¶
View Source
const EventSource = "Projects"
Variables ¶
View Source
var ( DisableAdvisoryLock = false UseBlockingAdvisoryLock = true )
Functions ¶
func NewHomeHandler ¶
func NewHomeHandler(agentSvc agents.AgentService) *homeHandler
func NewMockProjectDao ¶
func NewMockProjectDao() *projectDaoMock
func NewProjectGRPCHandler ¶
func NewProjectGRPCHandler(service ProjectService, generic services.GenericService, brokerFunc func() *server.EventBroker) pb.ProjectServiceServer
func NewProjectHandler ¶
func NewProjectHandler(project ProjectService, generic services.GenericService) *projectHandler
func PresentProject ¶
func ValidateProjectName ¶
func ValidateProjectName(name string) *errors.ServiceError
Types ¶
type Project ¶
type Project struct {
api.Meta
Name string `json:"name" gorm:"uniqueIndex;not null"`
DisplayName *string `json:"display_name"`
Description *string `json:"description"`
Labels *string `json:"labels"`
Annotations *string `json:"annotations"`
Status *string `json:"status"`
}
func ConvertProject ¶
type ProjectDao ¶
type ProjectDao interface {
Get(ctx context.Context, id string) (*Project, error)
Create(ctx context.Context, project *Project) (*Project, error)
Replace(ctx context.Context, project *Project) (*Project, error)
Delete(ctx context.Context, id string) error
FindByIDs(ctx context.Context, ids []string) (ProjectList, error)
All(ctx context.Context) (ProjectList, error)
}
func NewProjectDao ¶
func NewProjectDao(sessionFactory *db.SessionFactory) ProjectDao
type ProjectIndex ¶
type ProjectList ¶
type ProjectList []*Project
func (ProjectList) Index ¶
func (l ProjectList) Index() ProjectIndex
type ProjectPatchRequest ¶
type ProjectPatchRequest struct {
Name *string `json:"name,omitempty"`
DisplayName *string `json:"display_name,omitempty"`
Description *string `json:"description,omitempty"`
Labels *string `json:"labels,omitempty"`
Annotations *string `json:"annotations,omitempty"`
Status *string `json:"status,omitempty"`
}
type ProjectService ¶
type ProjectService interface {
Get(ctx context.Context, id string) (*Project, *errors.ServiceError)
Create(ctx context.Context, project *Project) (*Project, *errors.ServiceError)
Replace(ctx context.Context, project *Project) (*Project, *errors.ServiceError)
Delete(ctx context.Context, id string) *errors.ServiceError
All(ctx context.Context) (ProjectList, *errors.ServiceError)
FindByIDs(ctx context.Context, ids []string) (ProjectList, *errors.ServiceError)
OnUpsert(ctx context.Context, id string) error
OnDelete(ctx context.Context, id string) error
}
func NewProjectService ¶
func NewProjectService(lockFactory db.LockFactory, projectDao ProjectDao, events services.EventService) ProjectService
func Service ¶
func Service(s *environments.Services) ProjectService
type ServiceLocator ¶
type ServiceLocator func() ProjectService
func NewServiceLocator ¶
func NewServiceLocator(env *environments.Env) ServiceLocator
Click to show internal directories.
Click to hide internal directories.