Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterHandlers ¶
Types ¶
type CreateCommentRequest ¶
type CreateCommentRequest struct {
Body string `json:"body" validate:"required"`
SHA256 string `json:"sha256" validate:"required,alphanum,len=64"`
Username string
}
CreateCommentRequest represents a comment creation request.
type Repository ¶
type Repository interface {
// Get returns the comment with the specified comment ID.
Get(ctx context.Context, id string) (entity.Comment, error)
// Create saves a new comment in the storage.
Create(ctx context.Context, Comment entity.Comment) error
}
Repository encapsulates the logic to access comments from the data source.
func NewRepository ¶
func NewRepository(db *dbcontext.DB, logger log.Logger) Repository
NewRepository creates a new comment repository.
Click to show internal directories.
Click to hide internal directories.