Documentation
¶
Overview ¶
Package ticket provides types and functions related to tickets in a task tracking system.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Name ¶
type Name string
Name represents the name of a task tracker ticket. It is a string that identifies the ticket and is used for display purposes.
type Ticket ¶
type Ticket struct {
// contains filtered or unexported fields
}
Ticket represents a task tracker ticket.
func ParseTicket ¶
ParseTicket extracts a Ticket from the given string using the provided regular expression.
The regular expression should contain a capturing group that matches the ticket name. If the string is empty or does not match the regular expression, an empty Ticket is returned.
Example usage:
re := regexp.MustCompile(`^((?:TASK|PROJ|BUG)-\d+)`)
t := ParseTicket("TASK-1234 add new feature", re)
fmt.Println(t.Name()) // Output: TASK-1234
func (Ticket) Empty ¶
Empty checks if the Ticket is empty, which is determined by whether its Name is empty.