authors

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvKeyCoauthorsPath = "GITMOB_COAUTHORS_PATH"
)

Variables

View Source
var (
	CoAuthorsFilePath string
)

Functions

func EnsureCoauthorsFileExists

func EnsureCoauthorsFileExists(path string) error

Types

type Author

type Author struct {
	Name  string `json:"name"`
	Email string `json:"email"`
}

func MustParseOne

func MustParseOne(s string) Author

MustParseOne parses an author string into an Author and panics if parsing fails

func ParseOne

func ParseOne(s string) (Author, error)

ParseOne parses an author string into an Author

func (Author) CoauthorTag

func (a Author) CoauthorTag() string

func (Author) CoauthorTagBytes

func (a Author) CoauthorTagBytes() []byte

func (Author) InitialsFromName

func (a Author) InitialsFromName() string

func (Author) String

func (a Author) String() string

type AuthorWithInitials

type AuthorWithInitials struct {
	Initials string `json:"initials"`
	Name     string `json:"name"`
	Email    string `json:"email"`
}

type CoAuthorsFileContent

type CoAuthorsFileContent struct {
	CoAuthorsByInitial map[string]Author `json:"coauthors"`
}

func ReadCoAuthorsContent

func ReadCoAuthorsContent() (CoAuthorsFileContent, error)

func ReadCoAuthorsContentFromBytes

func ReadCoAuthorsContentFromBytes(b []byte) (CoAuthorsFileContent, error)

func ReadCoAuthorsContentFromFile

func ReadCoAuthorsContentFromFile(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) LookupByInitials

func (f CoAuthorsFileContent) LookupByInitials(initials ...string) []Author

Jump to

Keyboard shortcuts

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