internal/project¶
github.com/gamidoc/backend/internal/project
Types¶
ConvertInput¶
type ConvertInput struct {
CreateInput¶
type CreateInput struct {
Handler¶
type Handler struct {
Project¶
type Project struct {
Repository¶
type Repository interface {
SaveStepInput¶
type SaveStepInput struct {
Service¶
type Service struct {
SessionWizardReader¶
type SessionWizardReader interface {
UpdateInput¶
type UpdateInput struct {
Functions¶
Handler.Routes¶
func (h *Handler) Routes() chi.Router {
NewHandler¶
func NewHandler(service *Service) *Handler {
NewInitialWizardStatus¶
func NewInitialWizardStatus() wizard.Status {
NewService¶
func NewService(projects Repository, sessions SessionWizardReader, wizardService *wizard.Service, recommendationService *recommendation.Service) *Service {
Service.Create¶
func (s *Service) Create(ctx context.Context, userID string, input CreateInput) (Project, error) {
Service.CreateFromSession¶
func (s *Service) CreateFromSession(ctx context.Context, userID string, sessionID string, input ConvertInput) (Project, error) {
Service.Delete¶
func (s *Service) Delete(ctx context.Context, userID string, projectID string) error {
Service.Get¶
func (s *Service) Get(ctx context.Context, userID string, projectID string) (Project, error) {
Service.List¶
func (s *Service) List(ctx context.Context, userID string) ([]Project, error) {
Service.Recommend¶
func (s *Service) Recommend(ctx context.Context, userID string, projectID string, forStep int) (recommendation.Result, error) {
Service.SaveStep¶
func (s *Service) SaveStep(ctx context.Context, userID string, projectID string, stepNumber int, stepData json.RawMessage) (Project, error) {
Service.Update¶
func (s *Service) Update(ctx context.Context, userID string, projectID string, input UpdateInput) (Project, error) {
Variables¶
ErrForbiddenProject¶
var ErrForbiddenProject = errors.New("forbidden project")
ErrInvalidProjectName¶
var ErrInvalidProjectName = errors.New("invalid project name")
ErrProjectNotFound¶
var ErrProjectNotFound = errors.New("project not found")