projects

package
v0.0.0-...-e341b83 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 34 Imported by: 0

Documentation

Index

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 PresentProject(project *Project) openapi.Project

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

func ConvertProject(project openapi.Project) *Project

func (*Project) BeforeCreate

func (d *Project) BeforeCreate(tx *gorm.DB) error

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 ProjectIndex map[string]*Project

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

type ServiceLocator

type ServiceLocator func() ProjectService

func NewServiceLocator

func NewServiceLocator(env *environments.Env) ServiceLocator

Jump to

Keyboard shortcuts

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