Documentation
¶
Index ¶
- Variables
- func ConfigRead(bugYmls string, c *Config, progVersion string) (err error)
- func ConfigWrite(bugYmls string) (err error)
- func TitleToDirString(title string) string
- type Comment
- type Config
- type Directory
- type Issue
- func FindIssuesByTag(tags []string, config Config) []Issue
- func GetAllIssues(config Config) []Issue
- func LoadIssueByDirectory(dir string, config Config) (*Issue, error)
- func LoadIssueByHeuristic(id string, config Config) (*Issue, error)
- func LoadIssueByIdentifier(id string, config Config) (*Issue, error)
- func LoadIssueByIndex(idx int, config Config) (*Issue, error)
- func New(title string, config Config) (*Issue, error)
- func (i Issue) Close() error
- func (b *Issue) CommentIssue(comment Comment, config Config)
- func (b Issue) Description() string
- func (b Issue) Direr() Directory
- func (b Issue) HasTag(tag TagBoolTrue) bool
- func (b Issue) Identifier() string
- func (t Issue) Len() int
- func (b *Issue) LoadIssue(dir Directory, config Config)
- func (b Issue) Milestone() string
- func (b Issue) Priority() string
- func (i *Issue) Read(p []byte) (int, error)
- func (i *Issue) Remove() error
- func (b *Issue) RemoveComment(comment Comment)
- func (b *Issue) RemoveTag(tag TagBoolTrue, config Config)
- func (b *Issue) SetDescription(val string, config Config) error
- func (b Issue) SetField(fieldName string, value string, config Config) error
- func (b Issue) SetIdentifier(newValue string, config Config) error
- func (b Issue) SetMilestone(newValue string, config Config) error
- func (b Issue) SetPriority(newValue string, config Config) error
- func (b Issue) SetStatus(newStatus string, config Config) error
- func (b Issue) Status() string
- func (b Issue) StringTags() []string
- func (b *Issue) TagIssue(tag TagBoolTrue, config Config)
- func (b Issue) Tags() []TagBoolTrue
- func (b Issue) Title(options string) string
- func (i Issue) ToJSONString() (string, error)
- func (b Issue) ViewIssue()
- func (i *Issue) Write(data []byte) (n int, err error)
- func (i *Issue) WriteAt(data []byte, off int64) (n int, err error)
- type IssueNotFoundError
- type TagBoolTrue
- type TagKeyValue
Constants ¶
This section is empty.
Variables ¶
var ErrNoConfig = errors.New("No .fit.yml provided")
ErrNoConfig
var ErrNoDescription = errors.New("No description provided")
ErrNoDescription defines a new error.
var ErrNotFound = errors.New("Could not find issue")
ErrNotFound defines a new error.
Functions ¶
func ConfigRead ¶
ConfigRead assigns values to the Config type from .fit.yml.
func ConfigWrite ¶
func TitleToDirString ¶
Types ¶
type Config ¶
type Config struct { // FitDir aka RootDir or RepoDir // storage of location of dir containing: // issues directory // .fit.yml // likely .git // overridden by FIT/PMIT environment variable ** runtime only FitDir string `json:"FitDir"` // overridden by FIT/PMIT environment variable ** runtime only FitDirName string `json:"FitDirName"` // save the detected directory name ** runtime only ScmDir string `json:"ScmDir"` // save the detected scm type ** runtime only ScmType string `json:"ScmType"` // FitYmlDir * if present ** runtime only // Now important because this could be FitDir or ScmDir FitYmlDir string `json:"FitYmlDir"` // FitYmlDir+"/.fit.yml" or .bug.yml * if present ** runtime only FitYml string `json:"FitYml"` // Description contents for new issue or empty file (empty default) // relative to FitYmlDir, aka FitDir or ScmDir DefaultDescriptionFile string `json:"DefaultDescriptionFile"` // saves raw json files of import (true) or don't save (false, default) ImportXmlDump bool `json:"ImportXmlDump"` // import comments together (true) or separate files (false, default) ImportCommentsTogether bool `json:"ImportCommentsTogether"` // append to the program version ** runtime + append ProgramVersion string `json:"ProgramVersion"` // file name (Description is the default) set in main.go DescriptionFileName string `json:"DescriptionFileName"` // tag_key_value (true) or tag subdir (false, default) TagKeyValue bool `json:"TagKeyValue"` // tag_Field_value (true) or Field file and contents (false, default) NewFieldAsTag bool `json:"NewFieldAsTag"` // tag_field_value (true) or tag_Field_value (false, default) NewFieldLowerCase bool `json:"NewFieldLowerCase"` // github.com/settings/tokens GithubPersonalAccessToken string `json:"GithubPersonalAccessToken"` //* twilio.com/console "Dashboard" has the "account sid" public acct identifier TwilioAccountSid string `json:"TwilioAccountSid"` //* twilio "Auth Token" is the "Rest API Key" is for access TwilioAuthToken string `json:"TwilioAuthToken"` //* your twilio number TwilioPhoneNumberFrom string `json:"TwilioPhoneNumberFrom"` //* base url for notifications FitSite string `json:"FitSite"` // fit directories always recursive (true) or need -r cli option (false, default) MultipleDirs bool `json:"MultipleDirs"` // close will add tag_status_close (true) or not (false, default) CloseStatusTag bool `json:"CloseStatusTag"` // close will move (true, sets ClosePreventDelete=true) or not (false, default) CloseMove bool `json:"CloseMove"` // if using CloseMove this is inside FitDir ClosedDirName string `json:"ClosedDirName"` // close will prevent delete (true) or not (false), implies CloseMove or CloseStatusTag ClosePreventDelete bool `json:"ClosePreventDelete"` // Abbreviate Identifier as Id (true) or use Identifier (false, default) IdAbbreviate bool `json:"IdAbbreviate"` // Identifier Automatic assignment (true) or not (false, default) IdAutomatic bool `json:"IdAutomatic"` }
Config type holds .fit.yml configured values.
type Directory ¶
type Directory string
Directory type is a string path name.
func FitDirer ¶
FitDirer returns the directory containing the issues. The root directory contains the issues directory.
func ShortTitleToDir ¶
ShortTitleToDir truncates a title to 25 characters.
func TitleToDir ¶
TitleToDir returns a Directory from a string argument.
func (Directory) ShortNamer ¶
ShortNamer returns the directory name of a bug
type Issue ¶
type Issue struct { Dir Directory DescriptionFileName string TagArray []TagKeyValue // contains filtered or unexported fields }
An issue
func FindIssuesByTag ¶
FindIssuesByTag returns an array of tagged issues.
func GetAllIssues ¶
GetAllIssues returns an array of all issues.
func LoadIssueByDirectory ¶
LoadIssueByDirectory returns an issue from the directory name.
func LoadIssueByHeuristic ¶
LoadIssueByHeuristic returns an issue.
func LoadIssueByIdentifier ¶
LoadIssueByIdentifier returns an issue from a string Identifier
func LoadIssueByIndex ¶
LoadIssueByIndex returns an issue from an int index.
func (*Issue) CommentIssue ¶
CommentIssue writes a text file for an issue.
func (Issue) Description ¶
Description returns a string of an issue.
func (Issue) HasTag ¶
func (b Issue) HasTag(tag TagBoolTrue) bool
HasTag returns if an issue is assigned a tag.
func (Issue) Identifier ¶
Identifier returns the string from the Identifier of an issue.
func (*Issue) LoadIssue ¶
LoadIssue sets an issue's directory, modtime and DescriptionFileName and enforces IdAutomatic.
func (*Issue) RemoveComment ¶
RemoveComment deletes a comment file of an issue.
func (*Issue) RemoveTag ¶
func (b *Issue) RemoveTag(tag TagBoolTrue, config Config)
RemoveTag deletes a tag file of an issue.
func (*Issue) SetDescription ¶
SetDescription writes the Description file of an issue.
func (Issue) SetField ¶
SetField writes the string value to the file of an issue. NewFieldAsTag and NewFieldLowerCase are respected
func (Issue) SetIdentifier ¶
SetIdentifier writes the Identifier file to an issue.
func (Issue) SetMilestone ¶
SetMilestone writes the Milestone file to an issue.
func (Issue) SetPriority ¶
SetPriority writes the Priority file to an issue.
func (Issue) StringTags ¶
StringTags gets all Tags and returns []string.
func (*Issue) TagIssue ¶
func (b *Issue) TagIssue(tag TagBoolTrue, config Config)
TagIssue writes an empty *boolean* tag file: key, no value
func (Issue) Title ¶
Title returns a string with the name of an issue and optionally present Identifier, Status, Priority and tags.
func (Issue) ToJSONString ¶
ToJSONString encodes an issue. A string and an error are returned.
type IssueNotFoundError ¶
type IssueNotFoundError string
IssueNotFoundError defines a new error.
func (IssueNotFoundError) Error ¶
func (b IssueNotFoundError) Error() string
Error returns a string of the error.
type TagBoolTrue ¶
type TagBoolTrue string
TagBoolTrue only has a string key. Implied values are true/present and false/absent.
type TagKeyValue ¶
type TagKeyValue struct {
// contains filtered or unexported fields
}
TagKeyValue were added after type Tag (renamed to TagBoolTrue)