Documentation ¶
Overview ¶
Package engine contains implementations of task.Tracker for different task providers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interface ¶
type Interface interface { // List lists tasks by their IDs. List(ctx context.Context, ids []string) ([]task.Ticket, error) // Get returns a single task by its ID. Get(ctx context.Context, id string) (task.Ticket, error) }
Interface defines methods for task tracker engines.
type InterfaceMock ¶
type InterfaceMock struct { // GetFunc mocks the Get method. GetFunc func(ctx context.Context, id string) (task.Ticket, error) // ListFunc mocks the List method. ListFunc func(ctx context.Context, ids []string) ([]task.Ticket, error) // contains filtered or unexported fields }
InterfaceMock is a mock implementation of Interface.
func TestSomethingThatUsesInterface(t *testing.T) { // make and configure a mocked Interface mockedInterface := &InterfaceMock{ GetFunc: func(ctx context.Context, id string) (task.Ticket, error) { panic("mock out the Get method") }, ListFunc: func(ctx context.Context, ids []string) ([]task.Ticket, error) { panic("mock out the List method") }, } // use mockedInterface in code that requires Interface // and then make assertions. }
func (*InterfaceMock) GetCalls ¶
func (mock *InterfaceMock) GetCalls() []struct { Ctx context.Context ID string }
GetCalls gets all the calls that were made to Get. Check the length with:
len(mockedInterface.GetCalls())
type Jira ¶
type Jira struct {
// contains filtered or unexported fields
}
Jira is a Jira task tracker engine.
func NewJira ¶
func NewJira(ctx context.Context, params JiraParams) (*Jira, error)
NewJira creates a new Jira engine.
type JiraParams ¶
JiraParams is a set of parameters for Jira engine.
type Tracker ¶
type Tracker struct {
Interface
}
Tracker is a wrapper for task tracker engine with common functions for each tracker implementation.
type Unsupported ¶
type Unsupported struct{}
Unsupported is a tracker implementation that returns an error for each method.
Click to show internal directories.
Click to hide internal directories.