internal/design¶
github.com/gamidoc/backend/internal/design
Types¶
Dashboard¶
type Dashboard struct {
DashboardSection¶
type DashboardSection struct {
FAQEntry¶
type FAQEntry struct {
GeneratedReports¶
type GeneratedReports struct {
Handler¶
type Handler struct {
ProjectGuard¶
type ProjectGuard interface {
RenderSection¶
type RenderSection struct {
Report¶
type Report struct {
ReportBuilder¶
type ReportBuilder struct{}
ReportRepository¶
type ReportRepository interface {
ReportService¶
type ReportService struct {
SectionState¶
type SectionState struct {
Service¶
type Service struct{}
SessionGuard¶
type SessionGuard interface {
StateStore¶
type StateStore interface {
Status¶
type Status struct {
Functions¶
Handler.ProjectRoutes¶
func (h *Handler) ProjectRoutes() chi.Router {
Handler.SessionRoutes¶
func (h *Handler) SessionRoutes() chi.Router {
NewHandler¶
func NewHandler(
NewInitialStatus¶
func NewInitialStatus() Status {
NewReportBuilder¶
func NewReportBuilder() *ReportBuilder {
NewReportService¶
func NewReportService(assistant ai.Assistant, builder *ReportBuilder, store objectstore.ObjectStore, repo ReportRepository) *ReportService {
NewService¶
func NewService() *Service {
Order¶
func Order(path string) []int {
ReportBuilder.Build¶
func (b *ReportBuilder) Build(title string, version string, spark string, sections []RenderSection) ([]byte, error) {
ReportService.Generate¶
func (r *ReportService) Generate(ctx context.Context, kind string, id string, status Status) (GeneratedReports, error) {
ReportService.List¶
func (r *ReportService) List(ctx context.Context, projectID string) ([]Report, error) {
ReportService.Persist¶
func (r *ReportService) Persist(ctx context.Context, projectID string, reports []Report) error {
SectionDescription¶
func SectionDescription(number int) string {
SectionFAQ¶
func SectionFAQ(number int) []FAQEntry {
SectionKey¶
func SectionKey(number int) string {
SectionLines¶
func SectionLines(content json.RawMessage) []string {
SectionName¶
func SectionName(number int) string {
SectionPercent¶
func SectionPercent(state SectionState) int {
SectionPlainText¶
func SectionPlainText(content json.RawMessage) string {
SectionStatus¶
func SectionStatus(state SectionState) string {
Service.ApplyPrefill¶
func (s *Service) ApplyPrefill(current Status, prefill map[string]json.RawMessage) Status {
Service.ChoosePath¶
func (s *Service) ChoosePath(current Status, path string) (Status, error) {
Service.Dashboard¶
func (s *Service) Dashboard(current Status) (Dashboard, error) {
Service.SaveSection¶
func (s *Service) SaveSection(current Status, number int, content json.RawMessage, complete *bool, skip bool) (Status, error) {
Service.SaveSpark¶
func (s *Service) SaveSpark(current Status, spark string) Status {
Status.HasContent¶
func (s Status) HasContent() bool {
Status.Section¶
func (s Status) Section(number int) SectionState {
Variables¶
ErrAssistant¶
var ErrAssistant = errors.New("assistant error")
ErrDashboardLocked¶
var ErrDashboardLocked = errors.New("dashboard locked")
ErrInvalidPath¶
var ErrInvalidPath = errors.New("invalid path")
ErrInvalidReportVersion¶
var ErrInvalidReportVersion = errors.New("invalid report version")
ErrInvalidSectionData¶
var ErrInvalidSectionData = errors.New("invalid section data")
ErrInvalidSectionNumber¶
var ErrInvalidSectionNumber = errors.New("invalid section number")
ErrPathAlreadyChosen¶
var ErrPathAlreadyChosen = errors.New("path already chosen")
ErrPathNotChosen¶
var ErrPathNotChosen = errors.New("path not chosen")
ErrSectionLocked¶
var ErrSectionLocked = errors.New("section locked")
Constants¶
SectionCount¶
const SectionCount = 7