comment

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2024 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package comment implements functionality related to Phobos comments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateCommentInput

type CreateCommentInput struct {
	ThreadID   *string
	PipelineID *string
	ReleaseID  *string
	Text       string
}

CreateCommentInput is the input for creating a comment

type DeleteCommentInput

type DeleteCommentInput struct {
	Version *int
	ID      string
}

DeleteCommentInput is the input for deleting a comment

type Event

type Event struct {
	Comment *models.Comment
	Action  string
}

Event is a comment event

type GetCommentsInput

type GetCommentsInput struct {
	// Sort specifies the field to sort on and direction
	Sort *db.CommentSortableField
	// PaginationOptions supports cursor based pagination
	PaginationOptions *pagination.Options
	// Search is used to search for a comment
	Search *string
	// ThreadID to filter comments by
	ThreadID string
}

GetCommentsInput is the input for querying a list of comments

type GetThreadsInput

type GetThreadsInput struct {
	// Sort specifies the field to sort on and direction
	Sort *db.ThreadSortableField
	// PaginationOptions supports cursor based pagination
	PaginationOptions *pagination.Options
	// PipelineID filters the threads by the specified pipeline
	PipelineID *string
	// ReleaseID filters the threads by the specified release
	ReleaseID *string
}

GetThreadsInput is the input for querying a list of threads

type Service

type Service interface {
	GetCommentByID(ctx context.Context, id string) (*models.Comment, error)
	GetCommentsByIDs(ctx context.Context, idList []string) ([]models.Comment, error)
	GetCommentByPRN(ctx context.Context, prn string) (*models.Comment, error)
	GetComments(ctx context.Context, input *GetCommentsInput) (*db.CommentsResult, error)
	GetThreadByID(ctx context.Context, id string) (*models.Thread, error)
	GetThreadByPRN(ctx context.Context, prn string) (*models.Thread, error)
	GetThreadsByIDs(ctx context.Context, idList []string) ([]models.Thread, error)
	GetThreads(ctx context.Context, input *GetThreadsInput) (*db.ThreadsResult, error)
	CreateComment(ctx context.Context, input *CreateCommentInput) (*models.Comment, error)
	UpdateComment(ctx context.Context, input *UpdateCommentInput) (*models.Comment, error)
	DeleteComment(ctx context.Context, input *DeleteCommentInput) error
	SubscribeToComments(ctx context.Context, options *SubscribeToCommentsInput) (<-chan *Event, error)
}

Service implements all comment related functionality

func NewService

func NewService(
	logger logger.Logger,
	dbClient *db.Client,
	limitChecker limits.LimitChecker,
	eventManager *events.EventManager,
	activityService activityevent.Service,
) Service

NewService returns an instance of Service

type SubscribeToCommentsInput

type SubscribeToCommentsInput struct {
	PipelineID *string
	ReleaseID  *string
}

SubscribeToCommentsInput is the input for subscribing to a single comment

type UpdateCommentInput

type UpdateCommentInput struct {
	Version *int
	Text    string
	ID      string
}

UpdateCommentInput is the input for updating a comment

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL