tm

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsanaService

type AsanaService struct {
	// contains filtered or unexported fields
}

func NewAsanaService

func NewAsanaService(
	apiKey string,
	l *zerolog.Logger,
	cfg *config.HTTPAPI,
	ff *config.FeatureFlags,
) *AsanaService

NewAsanaService creates a new instance of the Asana service

func (*AsanaService) CreateComment

func (a *AsanaService) CreateComment(msg entities.Message) error

func (*AsanaService) GetTaskName

func (a *AsanaService) GetTaskName(mention *entities.TaskMention) (string, error)
func (a *AsanaService) GetTaskShortLink(mention *entities.TaskMention) (string, error)

func (*AsanaService) UpdateCustomField

func (a *AsanaService) UpdateCustomField(mention *entities.TaskMention, customFieldName, value string) error

func (*AsanaService) UpdateLastCommitInfo

func (a *AsanaService) UpdateLastCommitInfo(msg entities.Message) error

type ITaskManager

type ITaskManager interface {

	// UpdateCustomField updates the custom field of a task
	UpdateCustomField(mention *entities.TaskMention, customFieldName string, value string) error

	// CreateComment creates a comment on all message related tasks
	CreateComment(msg entities.Message) error

	// UpdateLastCommitInfo updates the last commit info of a task
	// via custom field or creating a comment
	UpdateLastCommitInfo(msg entities.Message) error

	// GetTaskShortLink returns the short link of a task
	//
	// todo: can be united with GetTaskName if update the api of the golang asana client
	// now doesn't use the asana client, creates only with the task_id
	GetTaskShortLink(mention *entities.TaskMention) (string, error)

	// GetTaskName returns the name of a task
	GetTaskName(mention *entities.TaskMention) (string, error)
}

ITaskManager is the interface for the task manager

Implementations: AsanaService

Jump to

Keyboard shortcuts

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