Documentation ¶
Index ¶
- Constants
- Variables
- func EnsureCoauthorsFileExists(path string) error
- func WriteCoauthorsContent(cc CoAuthorsFileContent) error
- func WriteCoauthorsContentToFilePath(path string, cc CoAuthorsFileContent) error
- type Author
- type AuthorList
- type AuthorWithInitials
- type CoAuthorsFileContent
- func (f CoAuthorsFileContent) FindAndFormatAsList(initials ...string) []string
- func (f CoAuthorsFileContent) FindInitialsFromCoAuthorStrings(ss ...string) []string
- func (f CoAuthorsFileContent) LookupByEmail(email ...string) []Author
- func (f CoAuthorsFileContent) LookupByInitials(initials ...string) []Author
- type DuplicateInitialsError
Constants ¶
View Source
const (
)Variables ¶
View Source
var (
CoAuthorsFilePath string
)
Functions ¶
func WriteCoauthorsContent ¶ added in v0.7.0
func WriteCoauthorsContent(cc CoAuthorsFileContent) error
func WriteCoauthorsContentToFilePath ¶ added in v0.7.0
func WriteCoauthorsContentToFilePath(path string, cc CoAuthorsFileContent) error
Types ¶
type Author ¶
func MustParseOne ¶
MustParseOne parses an author string into an Author and panics if parsing fails
func (Author) CoauthorTag ¶
func (Author) CoauthorTagBytes ¶
func (Author) InitialsFromName ¶
func (Author) LooksAnonymous ¶ added in v0.10.0
type AuthorList ¶ added in v0.6.1
type AuthorList struct {
Members []*Author `json:"members"`
}
AuthorList is a helper type to support string format when printing a list of authors
func (AuthorList) SortBy ¶ added in v0.6.1
func (m AuthorList) SortBy(less func(left, right *Author) bool)
func (AuthorList) String ¶ added in v0.6.1
func (m AuthorList) String() string
String implements Stringer to format our list output as a string
func (AuthorList) WriteToTable ¶ added in v0.6.1
func (m AuthorList) WriteToTable(table *tablewriter.Table)
type AuthorWithInitials ¶
type CoAuthorsFileContent ¶
func ReadCoAuthorsContent ¶
func ReadCoAuthorsContent() (CoAuthorsFileContent, error)
func ReadCoAuthorsContentFromBytes ¶
func ReadCoAuthorsContentFromBytes(b []byte) (CoAuthorsFileContent, error)
func ReadCoAuthorsContentFromFilePath ¶ added in v0.6.1
func ReadCoAuthorsContentFromFilePath(filePath string) (CoAuthorsFileContent, error)
func (CoAuthorsFileContent) FindAndFormatAsList ¶
func (f CoAuthorsFileContent) FindAndFormatAsList(initials ...string) []string
func (CoAuthorsFileContent) FindInitialsFromCoAuthorStrings ¶
func (f CoAuthorsFileContent) FindInitialsFromCoAuthorStrings(ss ...string) []string
func (CoAuthorsFileContent) LookupByEmail ¶ added in v0.10.0
func (f CoAuthorsFileContent) LookupByEmail(email ...string) []Author
func (CoAuthorsFileContent) LookupByInitials ¶
func (f CoAuthorsFileContent) LookupByInitials(initials ...string) []Author
type DuplicateInitialsError ¶ added in v0.8.0
func NewDuplicateInitialsError ¶ added in v0.8.0
func NewDuplicateInitialsError(duplicates map[string][]Author) DuplicateInitialsError
func (DuplicateInitialsError) Error ¶ added in v0.8.0
func (e DuplicateInitialsError) Error() string
Click to show internal directories.
Click to hide internal directories.