Documentation
¶
Overview ¶
Package document implements the document subdomain of the support module. Only the module facade (internal/module/support) may reach it.
Index ¶
- type Service
- func (s *Service) BatchDelete(ctx context.Context, req *dto.BatchDeleteDocumentRequest) error
- func (s *Service) Create(ctx context.Context, req *dto.CreateDocumentRequest) error
- func (s *Service) Delete(ctx context.Context, req *dto.DeleteDocumentRequest) error
- func (s *Service) GetDetail(ctx context.Context, req *dto.GetDocumentDetailRequest) (*dto.Document, error)
- func (s *Service) List(ctx context.Context, req *dto.GetDocumentListRequest) (*dto.GetDocumentListResponse, error)
- func (s *Service) QueryDetail(ctx context.Context, req *dto.QueryDocumentDetailRequest) (*dto.Document, error)
- func (s *Service) QueryList(ctx context.Context) (*dto.QueryDocumentListResponse, error)
- func (s *Service) Update(ctx context.Context, req *dto.UpdateDocumentRequest) error
- type SubscriptionReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service manages the help documents for the support facade.
func NewService ¶
func NewService(repo repository.DocumentRepo, subs SubscriptionReader) *Service
NewService builds the document service; subs may be nil, and then every reader sees the content for users without a subscription.
func (*Service) BatchDelete ¶
BatchDelete removes the documents one by one, stopping at the first failure.
func (*Service) GetDetail ¶
func (s *Service) GetDetail(ctx context.Context, req *dto.GetDocumentDetailRequest) (*dto.Document, error)
GetDetail returns a document for the admin panel, hidden ones included.
func (*Service) List ¶
func (s *Service) List(ctx context.Context, req *dto.GetDocumentListRequest) (*dto.GetDocumentListResponse, error)
List pages the documents for the admin panel.
func (*Service) QueryDetail ¶
func (s *Service) QueryDetail(ctx context.Context, req *dto.QueryDocumentDetailRequest) (*dto.Document, error)
QueryDetail serves the user-facing detail. A hidden document answers exactly like a missing one, so the endpoint cannot be used to read or probe unpublished documents; the admin detail (GetDetail) still returns them.