Skip to content

internal/session

github.com/gamidoc/backend/internal/session

Types

Handler

type Handler struct {

Repository

type Repository interface {

Service

type Service struct {

Session

type Session struct {

Functions

Handler.Convert

func (h *Handler) Convert(w http.ResponseWriter, r *http.Request) {

Handler.Routes

func (h *Handler) Routes() chi.Router {

NewHandler

func NewHandler(service *Service, projectService *project.Service) *Handler {

NewInitialWizardStatus

func NewInitialWizardStatus() wizard.Status {

NewService

func NewService(sessions Repository, ttl time.Duration, wizardService *wizard.Service, recommendationService *recommendation.Service) *Service {

Service.Create

func (s *Service) Create(ctx context.Context) (Session, error) {

Service.Get

func (s *Service) Get(ctx context.Context, id string) (Session, error) {

Service.Recommend

func (s *Service) Recommend(ctx context.Context, sessionID string, forStep int) (recommendation.Result, error) {

Service.SaveStep

func (s *Service) SaveStep(ctx context.Context, sessionID string, stepNumber int, stepData json.RawMessage) (Session, error) {

Variables

ErrSessionNotFound

var ErrSessionNotFound = errors.New("session not found")