gn

package
v0.0.0-...-50ed3c3 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	Name  string
	Email string
}

type GN

type GN struct {
	// Editor is the name of the binary of the text editor
	Editor string
	// NotesPath is the path in which the notes are stored
	NotesPath string
	// Project is the name of the project for the notes
	Project string
	// Branch is the name of the branch for the notes
	Branch string
	// commit message is the message to be used on commit
	CommitMessage string
	// AlwaysCommit indicates if all note edit should be commited
	AlwaysCommit bool
	// RemoteURL is the URL to the remote repository
	RemoteURL string
	// contains filtered or unexported fields
}

func New

func New(debug bool) *GN

New creates a new GN with required internal fields set

func (*GN) AddOrigin

func (gn *GN) AddOrigin(url string) error

func (*GN) Commit

func (gn *GN) Commit() error

func (*GN) Delete

func (gn *GN) Delete() error

func (*GN) Edit

func (gn *GN) Edit() error

Edit opens the user's current project and branch on the selected editor. The behaviour of this method depends on the working directory, since it uses the current dir to find the project's name

func (*GN) Path

func (gn *GN) Path() string

Path returns the path in which the notes are stored

func (*GN) Pull

func (gn *GN) Pull() error

Pull pushes git notes to the remote repository

func (*GN) Push

func (gn *GN) Push() error

Push pushes git notes to the remote repository

func (*GN) ReadNote

func (gn *GN) ReadNote() (string, error)

ReadNote returns the content of the note

Jump to

Keyboard shortcuts

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