manifest

package
v0.0.0-...-e6605fe Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CoauthorTypeGitHub = "github"
	CoauthorTypeGitLab = "gitlab"
	CoauthorTypeManual = "manual"
)

Coauthor types

View Source
const DefaultPath = "~/.config/partner/manifest.json"

Variables

This section is empty.

Functions

func WriteFile

func WriteFile(path string, m *Manifest) error

WriteFile saves the manifest to a JSON file

Types

type Coauthor

type Coauthor struct {
	ID    string `json:"id"`
	Type  string `json:"type"`
	Name  string `json:"name"`
	Email string `json:"email"`
}

Coauthor is an identity to be referenced as a commit coauthor

type Manifest

type Manifest struct {
	Coauthors map[string]Coauthor `json:"coauthors"`
}

Manifest contains all coauthors

func Load

func Load(path string) (*Manifest, error)

Load reads a Manifest

func (*Manifest) Add

func (m *Manifest) Add(coauthors ...Coauthor) error

Add adds coauthors to the Manifest

func (*Manifest) Find

func (m *Manifest) Find(ids ...string) ([]Coauthor, error)

Find looks up a list of coauthors by their IDs

func (*Manifest) Remove

func (m *Manifest) Remove(ids ...string) error

Remove removes coauthors by their IDs

func (Manifest) Slice

func (m Manifest) Slice() []Coauthor

Jump to

Keyboard shortcuts

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