id
int32
0
167k
repo
stringlengths
5
54
path
stringlengths
4
155
func_name
stringlengths
1
118
original_string
stringlengths
52
85.5k
language
stringclasses
1 value
code
stringlengths
52
85.5k
code_tokens
list
docstring
stringlengths
6
2.61k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
85
252
29,100
paulmach/orb
encoding/mvt/layer.go
ProjectToWGS84
func (ls Layers) ProjectToWGS84(tile maptile.Tile) { for _, l := range ls { l.ProjectToWGS84(tile) } }
go
func (ls Layers) ProjectToWGS84(tile maptile.Tile) { for _, l := range ls { l.ProjectToWGS84(tile) } }
[ "func", "(", "ls", "Layers", ")", "ProjectToWGS84", "(", "tile", "maptile", ".", "Tile", ")", "{", "for", "_", ",", "l", ":=", "range", "ls", "{", "l", ".", "ProjectToWGS84", "(", "tile", ")", "\n", "}", "\n", "}" ]
// ProjectToWGS84 will project all the geometries in all the layers backed // to WGS84 from the extent and mercator projection.
[ "ProjectToWGS84", "will", "project", "all", "the", "geometries", "in", "all", "the", "layers", "backed", "to", "WGS84", "from", "the", "extent", "and", "mercator", "projection", "." ]
c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29
https://github.com/paulmach/orb/blob/c6e407b203494d3b1edb9fd5cae4cf34a4ae0f29/encoding/mvt/layer.go#L87-L91
29,101
libgit2/git2go
config.go
NewConfig
func NewConfig() (*Config, error) { config := new(Config) runtime.LockOSThread() defer runtime.UnlockOSThread() if ret := C.git_config_new(&config.ptr); ret < 0 { return nil, MakeGitError(ret) } return config, nil }
go
func NewConfig() (*Config, error) { config := new(Config) runtime.LockOSThread() defer runtime.UnlockOSThread() if ret := C.git_config_new(&config.ptr); ret < 0 { return nil, MakeGitError(ret) } return config, nil }
[ "func", "NewConfig", "(", ")", "(", "*", "Config", ",", "error", ")", "{", "config", ":=", "new", "(", "Config", ")", "\n\n", "runtime", ".", "LockOSThread", "(", ")", "\n", "defer", "runtime", ".", "UnlockOSThread", "(", ")", "\n\n", "if", "ret", ":...
// NewConfig creates a new empty configuration object
[ "NewConfig", "creates", "a", "new", "empty", "configuration", "object" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/config.go#L59-L70
29,102
libgit2/git2go
config.go
AddFile
func (c *Config) AddFile(path string, level ConfigLevel, force bool) error { cpath := C.CString(path) defer C.free(unsafe.Pointer(cpath)) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_config_add_file_ondisk(c.ptr, cpath, C.git_config_level_t(level), nil, cbool(force)) runtime.KeepAlive(c) ...
go
func (c *Config) AddFile(path string, level ConfigLevel, force bool) error { cpath := C.CString(path) defer C.free(unsafe.Pointer(cpath)) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_config_add_file_ondisk(c.ptr, cpath, C.git_config_level_t(level), nil, cbool(force)) runtime.KeepAlive(c) ...
[ "func", "(", "c", "*", "Config", ")", "AddFile", "(", "path", "string", ",", "level", "ConfigLevel", ",", "force", "bool", ")", "error", "{", "cpath", ":=", "C", ".", "CString", "(", "path", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".",...
// AddFile adds a file-backed backend to the config object at the specified level.
[ "AddFile", "adds", "a", "file", "-", "backed", "backend", "to", "the", "config", "object", "at", "the", "specified", "level", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/config.go#L73-L87
29,103
libgit2/git2go
config.go
NewIterator
func (c *Config) NewIterator() (*ConfigIterator, error) { iter := &ConfigIterator{cfg: c} runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_config_iterator_new(&iter.ptr, c.ptr) if ret < 0 { return nil, MakeGitError(ret) } return iter, nil }
go
func (c *Config) NewIterator() (*ConfigIterator, error) { iter := &ConfigIterator{cfg: c} runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_config_iterator_new(&iter.ptr, c.ptr) if ret < 0 { return nil, MakeGitError(ret) } return iter, nil }
[ "func", "(", "c", "*", "Config", ")", "NewIterator", "(", ")", "(", "*", "ConfigIterator", ",", "error", ")", "{", "iter", ":=", "&", "ConfigIterator", "{", "cfg", ":", "c", "}", "\n\n", "runtime", ".", "LockOSThread", "(", ")", "\n", "defer", "runti...
// NewIterator creates an iterator over each entry in the // configuration
[ "NewIterator", "creates", "an", "iterator", "over", "each", "entry", "in", "the", "configuration" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/config.go#L187-L199
29,104
libgit2/git2go
config.go
NewIteratorGlob
func (c *Config) NewIteratorGlob(regexp string) (*ConfigIterator, error) { iter := &ConfigIterator{cfg: c} cregexp := C.CString(regexp) defer C.free(unsafe.Pointer(cregexp)) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_config_iterator_glob_new(&iter.ptr, c.ptr, cregexp) if ret < 0 { ret...
go
func (c *Config) NewIteratorGlob(regexp string) (*ConfigIterator, error) { iter := &ConfigIterator{cfg: c} cregexp := C.CString(regexp) defer C.free(unsafe.Pointer(cregexp)) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_config_iterator_glob_new(&iter.ptr, c.ptr, cregexp) if ret < 0 { ret...
[ "func", "(", "c", "*", "Config", ")", "NewIteratorGlob", "(", "regexp", "string", ")", "(", "*", "ConfigIterator", ",", "error", ")", "{", "iter", ":=", "&", "ConfigIterator", "{", "cfg", ":", "c", "}", "\n", "cregexp", ":=", "C", ".", "CString", "("...
// NewIteratorGlob creates an iterator over each entry in the // configuration whose name matches the given regular expression
[ "NewIteratorGlob", "creates", "an", "iterator", "over", "each", "entry", "in", "the", "configuration", "whose", "name", "matches", "the", "given", "regular", "expression" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/config.go#L203-L217
29,105
libgit2/git2go
config.go
OpenLevel
func (c *Config) OpenLevel(parent *Config, level ConfigLevel) (*Config, error) { config := new(Config) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_config_open_level(&config.ptr, parent.ptr, C.git_config_level_t(level)) runtime.KeepAlive(c) runtime.KeepAlive(parent) if ret < 0 { return ...
go
func (c *Config) OpenLevel(parent *Config, level ConfigLevel) (*Config, error) { config := new(Config) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_config_open_level(&config.ptr, parent.ptr, C.git_config_level_t(level)) runtime.KeepAlive(c) runtime.KeepAlive(parent) if ret < 0 { return ...
[ "func", "(", "c", "*", "Config", ")", "OpenLevel", "(", "parent", "*", "Config", ",", "level", "ConfigLevel", ")", "(", "*", "Config", ",", "error", ")", "{", "config", ":=", "new", "(", "Config", ")", "\n\n", "runtime", ".", "LockOSThread", "(", ")"...
// OpenLevel creates a single-level focused config object from a multi-level one
[ "OpenLevel", "creates", "a", "single", "-", "level", "focused", "config", "object", "from", "a", "multi", "-", "level", "one" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/config.go#L330-L344
29,106
libgit2/git2go
config.go
OpenOndisk
func OpenOndisk(path string) (*Config, error) { cpath := C.CString(path) defer C.free(unsafe.Pointer(cpath)) config := new(Config) runtime.LockOSThread() defer runtime.UnlockOSThread() if ret := C.git_config_open_ondisk(&config.ptr, cpath); ret < 0 { return nil, MakeGitError(ret) } return config, nil }
go
func OpenOndisk(path string) (*Config, error) { cpath := C.CString(path) defer C.free(unsafe.Pointer(cpath)) config := new(Config) runtime.LockOSThread() defer runtime.UnlockOSThread() if ret := C.git_config_open_ondisk(&config.ptr, cpath); ret < 0 { return nil, MakeGitError(ret) } return config, nil }
[ "func", "OpenOndisk", "(", "path", "string", ")", "(", "*", "Config", ",", "error", ")", "{", "cpath", ":=", "C", ".", "CString", "(", "path", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cpath", ")", ")", "\n\n", "c...
// OpenOndisk creates a new config instance containing a single on-disk file
[ "OpenOndisk", "creates", "a", "new", "config", "instance", "containing", "a", "single", "on", "-", "disk", "file" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/config.go#L347-L361
29,107
libgit2/git2go
config.go
Next
func (iter *ConfigIterator) Next() (*ConfigEntry, error) { var centry *C.git_config_entry runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_config_next(&centry, iter.ptr) if ret < 0 { return nil, MakeGitError(ret) } entry := newConfigEntryFromC(centry) runtime.KeepAlive(iter) return entr...
go
func (iter *ConfigIterator) Next() (*ConfigEntry, error) { var centry *C.git_config_entry runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_config_next(&centry, iter.ptr) if ret < 0 { return nil, MakeGitError(ret) } entry := newConfigEntryFromC(centry) runtime.KeepAlive(iter) return entr...
[ "func", "(", "iter", "*", "ConfigIterator", ")", "Next", "(", ")", "(", "*", "ConfigEntry", ",", "error", ")", "{", "var", "centry", "*", "C", ".", "git_config_entry", "\n\n", "runtime", ".", "LockOSThread", "(", ")", "\n", "defer", "runtime", ".", "Un...
// Next returns the next entry for this iterator
[ "Next", "returns", "the", "next", "entry", "for", "this", "iterator" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/config.go#L369-L384
29,108
libgit2/git2go
config.go
ConfigFindProgramdata
func ConfigFindProgramdata() (string, error) { var buf C.git_buf defer C.git_buf_dispose(&buf) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_config_find_programdata(&buf) if ret < 0 { return "", MakeGitError(ret) } return C.GoString(buf.ptr), nil }
go
func ConfigFindProgramdata() (string, error) { var buf C.git_buf defer C.git_buf_dispose(&buf) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_config_find_programdata(&buf) if ret < 0 { return "", MakeGitError(ret) } return C.GoString(buf.ptr), nil }
[ "func", "ConfigFindProgramdata", "(", ")", "(", "string", ",", "error", ")", "{", "var", "buf", "C", ".", "git_buf", "\n", "defer", "C", ".", "git_buf_dispose", "(", "&", "buf", ")", "\n\n", "runtime", ".", "LockOSThread", "(", ")", "\n", "defer", "run...
// ConfigFindProgramdata locate the path to the configuration file in ProgramData. // // Look for the file in %PROGRAMDATA%\Git\config used by portable git.
[ "ConfigFindProgramdata", "locate", "the", "path", "to", "the", "configuration", "file", "in", "ProgramData", ".", "Look", "for", "the", "file", "in", "%PROGRAMDATA%", "\\", "Git", "\\", "config", "used", "by", "portable", "git", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/config.go#L439-L452
29,109
libgit2/git2go
merge.go
MergeAnalysis
func (r *Repository) MergeAnalysis(theirHeads []*AnnotatedCommit) (MergeAnalysis, MergePreference, error) { runtime.LockOSThread() defer runtime.UnlockOSThread() gmerge_head_array := make([]*C.git_annotated_commit, len(theirHeads)) for i := 0; i < len(theirHeads); i++ { gmerge_head_array[i] = theirHeads[i].ptr ...
go
func (r *Repository) MergeAnalysis(theirHeads []*AnnotatedCommit) (MergeAnalysis, MergePreference, error) { runtime.LockOSThread() defer runtime.UnlockOSThread() gmerge_head_array := make([]*C.git_annotated_commit, len(theirHeads)) for i := 0; i < len(theirHeads); i++ { gmerge_head_array[i] = theirHeads[i].ptr ...
[ "func", "(", "r", "*", "Repository", ")", "MergeAnalysis", "(", "theirHeads", "[", "]", "*", "AnnotatedCommit", ")", "(", "MergeAnalysis", ",", "MergePreference", ",", "error", ")", "{", "runtime", ".", "LockOSThread", "(", ")", "\n", "defer", "runtime", "...
// MergeAnalysis returns the possible actions which could be taken by // a 'git-merge' command. There may be multiple answers, so the first // return value is a bitmask of MergeAnalysis values.
[ "MergeAnalysis", "returns", "the", "possible", "actions", "which", "could", "be", "taken", "by", "a", "git", "-", "merge", "command", ".", "There", "may", "be", "multiple", "answers", "so", "the", "first", "return", "value", "is", "a", "bitmask", "of", "Me...
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/merge.go#L193-L211
29,110
libgit2/git2go
merge.go
MergeBases
func (r *Repository) MergeBases(one, two *Oid) ([]*Oid, error) { runtime.LockOSThread() defer runtime.UnlockOSThread() var coids C.git_oidarray ret := C.git_merge_bases(&coids, r.ptr, one.toC(), two.toC()) runtime.KeepAlive(one) runtime.KeepAlive(two) if ret < 0 { return make([]*Oid, 0), MakeGitError(ret) } ...
go
func (r *Repository) MergeBases(one, two *Oid) ([]*Oid, error) { runtime.LockOSThread() defer runtime.UnlockOSThread() var coids C.git_oidarray ret := C.git_merge_bases(&coids, r.ptr, one.toC(), two.toC()) runtime.KeepAlive(one) runtime.KeepAlive(two) if ret < 0 { return make([]*Oid, 0), MakeGitError(ret) } ...
[ "func", "(", "r", "*", "Repository", ")", "MergeBases", "(", "one", ",", "two", "*", "Oid", ")", "(", "[", "]", "*", "Oid", ",", "error", ")", "{", "runtime", ".", "LockOSThread", "(", ")", "\n", "defer", "runtime", ".", "UnlockOSThread", "(", ")",...
// MergeBases retrieves the list of merge bases between two commits. // // If none are found, an empty slice is returned and the error is set // approprately
[ "MergeBases", "retrieves", "the", "list", "of", "merge", "bases", "between", "two", "commits", ".", "If", "none", "are", "found", "an", "empty", "slice", "is", "returned", "and", "the", "error", "is", "set", "approprately" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/merge.go#L271-L297
29,111
libgit2/git2go
note.go
Create
func (c *NoteCollection) Create( ref string, author, committer *Signature, id *Oid, note string, force bool) (*Oid, error) { oid := new(Oid) var cref *C.char if ref == "" { cref = nil } else { cref = C.CString(ref) defer C.free(unsafe.Pointer(cref)) } authorSig, err := author.toC() if err != nil { r...
go
func (c *NoteCollection) Create( ref string, author, committer *Signature, id *Oid, note string, force bool) (*Oid, error) { oid := new(Oid) var cref *C.char if ref == "" { cref = nil } else { cref = C.CString(ref) defer C.free(unsafe.Pointer(cref)) } authorSig, err := author.toC() if err != nil { r...
[ "func", "(", "c", "*", "NoteCollection", ")", "Create", "(", "ref", "string", ",", "author", ",", "committer", "*", "Signature", ",", "id", "*", "Oid", ",", "note", "string", ",", "force", "bool", ")", "(", "*", "Oid", ",", "error", ")", "{", "oid"...
// Create adds a note for an object
[ "Create", "adds", "a", "note", "for", "an", "object" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/note.go#L20-L61
29,112
libgit2/git2go
note.go
Read
func (c *NoteCollection) Read(ref string, id *Oid) (*Note, error) { var cref *C.char if ref == "" { cref = nil } else { cref = C.CString(ref) defer C.free(unsafe.Pointer(cref)) } runtime.LockOSThread() defer runtime.UnlockOSThread() var ptr *C.git_note ret := C.git_note_read(&ptr, c.repo.ptr, cref, id.t...
go
func (c *NoteCollection) Read(ref string, id *Oid) (*Note, error) { var cref *C.char if ref == "" { cref = nil } else { cref = C.CString(ref) defer C.free(unsafe.Pointer(cref)) } runtime.LockOSThread() defer runtime.UnlockOSThread() var ptr *C.git_note ret := C.git_note_read(&ptr, c.repo.ptr, cref, id.t...
[ "func", "(", "c", "*", "NoteCollection", ")", "Read", "(", "ref", "string", ",", "id", "*", "Oid", ")", "(", "*", "Note", ",", "error", ")", "{", "var", "cref", "*", "C", ".", "char", "\n", "if", "ref", "==", "\"", "\"", "{", "cref", "=", "ni...
// Read reads the note for an object
[ "Read", "reads", "the", "note", "for", "an", "object" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/note.go#L64-L85
29,113
libgit2/git2go
note.go
Remove
func (c *NoteCollection) Remove(ref string, author, committer *Signature, id *Oid) error { var cref *C.char if ref == "" { cref = nil } else { cref = C.CString(ref) defer C.free(unsafe.Pointer(cref)) } authorSig, err := author.toC() if err != nil { return err } defer C.git_signature_free(authorSig) c...
go
func (c *NoteCollection) Remove(ref string, author, committer *Signature, id *Oid) error { var cref *C.char if ref == "" { cref = nil } else { cref = C.CString(ref) defer C.free(unsafe.Pointer(cref)) } authorSig, err := author.toC() if err != nil { return err } defer C.git_signature_free(authorSig) c...
[ "func", "(", "c", "*", "NoteCollection", ")", "Remove", "(", "ref", "string", ",", "author", ",", "committer", "*", "Signature", ",", "id", "*", "Oid", ")", "error", "{", "var", "cref", "*", "C", ".", "char", "\n", "if", "ref", "==", "\"", "\"", ...
// Remove removes the note for an object
[ "Remove", "removes", "the", "note", "for", "an", "object" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/note.go#L88-L119
29,114
libgit2/git2go
note.go
DefaultRef
func (c *NoteCollection) DefaultRef() (string, error) { buf := C.git_buf{} runtime.LockOSThread() defer runtime.UnlockOSThread() ecode := C.git_note_default_ref(&buf, c.repo.ptr) runtime.KeepAlive(c) if ecode < 0 { return "", MakeGitError(ecode) } ret := C.GoString(buf.ptr) C.git_buf_dispose(&buf) retur...
go
func (c *NoteCollection) DefaultRef() (string, error) { buf := C.git_buf{} runtime.LockOSThread() defer runtime.UnlockOSThread() ecode := C.git_note_default_ref(&buf, c.repo.ptr) runtime.KeepAlive(c) if ecode < 0 { return "", MakeGitError(ecode) } ret := C.GoString(buf.ptr) C.git_buf_dispose(&buf) retur...
[ "func", "(", "c", "*", "NoteCollection", ")", "DefaultRef", "(", ")", "(", "string", ",", "error", ")", "{", "buf", ":=", "C", ".", "git_buf", "{", "}", "\n\n", "runtime", ".", "LockOSThread", "(", ")", "\n", "defer", "runtime", ".", "UnlockOSThread", ...
// DefaultRef returns the default notes reference for a repository
[ "DefaultRef", "returns", "the", "default", "notes", "reference", "for", "a", "repository" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/note.go#L122-L138
29,115
libgit2/git2go
note.go
Free
func (n *Note) Free() error { if n.ptr == nil { return ErrInvalid } runtime.SetFinalizer(n, nil) C.git_note_free(n.ptr) n.ptr = nil return nil }
go
func (n *Note) Free() error { if n.ptr == nil { return ErrInvalid } runtime.SetFinalizer(n, nil) C.git_note_free(n.ptr) n.ptr = nil return nil }
[ "func", "(", "n", "*", "Note", ")", "Free", "(", ")", "error", "{", "if", "n", ".", "ptr", "==", "nil", "{", "return", "ErrInvalid", "\n", "}", "\n", "runtime", ".", "SetFinalizer", "(", "n", ",", "nil", ")", "\n", "C", ".", "git_note_free", "(",...
// Free frees a git_note object
[ "Free", "frees", "a", "git_note", "object" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/note.go#L153-L161
29,116
libgit2/git2go
note.go
Author
func (n *Note) Author() *Signature { ptr := C.git_note_author(n.ptr) return newSignatureFromC(ptr) }
go
func (n *Note) Author() *Signature { ptr := C.git_note_author(n.ptr) return newSignatureFromC(ptr) }
[ "func", "(", "n", "*", "Note", ")", "Author", "(", ")", "*", "Signature", "{", "ptr", ":=", "C", ".", "git_note_author", "(", "n", ".", "ptr", ")", "\n", "return", "newSignatureFromC", "(", "ptr", ")", "\n", "}" ]
// Author returns the signature of the note author
[ "Author", "returns", "the", "signature", "of", "the", "note", "author" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/note.go#L164-L167
29,117
libgit2/git2go
note.go
Id
func (n *Note) Id() *Oid { ptr := C.git_note_id(n.ptr) runtime.KeepAlive(n) return newOidFromC(ptr) }
go
func (n *Note) Id() *Oid { ptr := C.git_note_id(n.ptr) runtime.KeepAlive(n) return newOidFromC(ptr) }
[ "func", "(", "n", "*", "Note", ")", "Id", "(", ")", "*", "Oid", "{", "ptr", ":=", "C", ".", "git_note_id", "(", "n", ".", "ptr", ")", "\n", "runtime", ".", "KeepAlive", "(", "n", ")", "\n", "return", "newOidFromC", "(", "ptr", ")", "\n", "}" ]
// Id returns the note object's id
[ "Id", "returns", "the", "note", "object", "s", "id" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/note.go#L170-L174
29,118
libgit2/git2go
note.go
Committer
func (n *Note) Committer() *Signature { ptr := C.git_note_committer(n.ptr) runtime.KeepAlive(n) return newSignatureFromC(ptr) }
go
func (n *Note) Committer() *Signature { ptr := C.git_note_committer(n.ptr) runtime.KeepAlive(n) return newSignatureFromC(ptr) }
[ "func", "(", "n", "*", "Note", ")", "Committer", "(", ")", "*", "Signature", "{", "ptr", ":=", "C", ".", "git_note_committer", "(", "n", ".", "ptr", ")", "\n", "runtime", ".", "KeepAlive", "(", "n", ")", "\n", "return", "newSignatureFromC", "(", "ptr...
// Committer returns the signature of the note committer
[ "Committer", "returns", "the", "signature", "of", "the", "note", "committer" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/note.go#L177-L181
29,119
libgit2/git2go
note.go
Message
func (n *Note) Message() string { ret := C.GoString(C.git_note_message(n.ptr)) runtime.KeepAlive(n) return ret }
go
func (n *Note) Message() string { ret := C.GoString(C.git_note_message(n.ptr)) runtime.KeepAlive(n) return ret }
[ "func", "(", "n", "*", "Note", ")", "Message", "(", ")", "string", "{", "ret", ":=", "C", ".", "GoString", "(", "C", ".", "git_note_message", "(", "n", ".", "ptr", ")", ")", "\n", "runtime", ".", "KeepAlive", "(", "n", ")", "\n", "return", "ret",...
// Message returns the note message
[ "Message", "returns", "the", "note", "message" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/note.go#L184-L188
29,120
libgit2/git2go
note.go
NewNoteIterator
func (repo *Repository) NewNoteIterator(ref string) (*NoteIterator, error) { var cref *C.char if ref == "" { cref = nil } else { cref = C.CString(ref) defer C.free(unsafe.Pointer(cref)) } var ptr *C.git_note_iterator runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_note_iterator_new(&...
go
func (repo *Repository) NewNoteIterator(ref string) (*NoteIterator, error) { var cref *C.char if ref == "" { cref = nil } else { cref = C.CString(ref) defer C.free(unsafe.Pointer(cref)) } var ptr *C.git_note_iterator runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_note_iterator_new(&...
[ "func", "(", "repo", "*", "Repository", ")", "NewNoteIterator", "(", "ref", "string", ")", "(", "*", "NoteIterator", ",", "error", ")", "{", "var", "cref", "*", "C", ".", "char", "\n", "if", "ref", "==", "\"", "\"", "{", "cref", "=", "nil", "\n", ...
// NewNoteIterator creates a new iterator for notes
[ "NewNoteIterator", "creates", "a", "new", "iterator", "for", "notes" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/note.go#L197-L220
29,121
libgit2/git2go
note.go
Free
func (v *NoteIterator) Free() { runtime.SetFinalizer(v, nil) C.git_note_iterator_free(v.ptr) }
go
func (v *NoteIterator) Free() { runtime.SetFinalizer(v, nil) C.git_note_iterator_free(v.ptr) }
[ "func", "(", "v", "*", "NoteIterator", ")", "Free", "(", ")", "{", "runtime", ".", "SetFinalizer", "(", "v", ",", "nil", ")", "\n", "C", ".", "git_note_iterator_free", "(", "v", ".", "ptr", ")", "\n", "}" ]
// Free frees the note interator
[ "Free", "frees", "the", "note", "interator" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/note.go#L223-L226
29,122
libgit2/git2go
blob.go
Write
func (stream *BlobWriteStream) Write(p []byte) (int, error) { header := (*reflect.SliceHeader)(unsafe.Pointer(&p)) ptr := (*C.char)(unsafe.Pointer(header.Data)) size := C.size_t(header.Len) runtime.LockOSThread() defer runtime.UnlockOSThread() ecode := C._go_git_writestream_write(stream.ptr, ptr, size) runtime...
go
func (stream *BlobWriteStream) Write(p []byte) (int, error) { header := (*reflect.SliceHeader)(unsafe.Pointer(&p)) ptr := (*C.char)(unsafe.Pointer(header.Data)) size := C.size_t(header.Len) runtime.LockOSThread() defer runtime.UnlockOSThread() ecode := C._go_git_writestream_write(stream.ptr, ptr, size) runtime...
[ "func", "(", "stream", "*", "BlobWriteStream", ")", "Write", "(", "p", "[", "]", "byte", ")", "(", "int", ",", "error", ")", "{", "header", ":=", "(", "*", "reflect", ".", "SliceHeader", ")", "(", "unsafe", ".", "Pointer", "(", "&", "p", ")", ")"...
// Implement io.Writer
[ "Implement", "io", ".", "Writer" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/blob.go#L135-L150
29,123
libgit2/git2go
diff.go
DiffBlobs
func DiffBlobs(oldBlob *Blob, oldAsPath string, newBlob *Blob, newAsPath string, opts *DiffOptions, fileCallback DiffForEachFileCallback, detail DiffDetail) error { data := &diffForEachData{ FileCallback: fileCallback, } intHunks := C.int(0) if detail >= DiffDetailHunks { intHunks = C.int(1) } intLines := C...
go
func DiffBlobs(oldBlob *Blob, oldAsPath string, newBlob *Blob, newAsPath string, opts *DiffOptions, fileCallback DiffForEachFileCallback, detail DiffDetail) error { data := &diffForEachData{ FileCallback: fileCallback, } intHunks := C.int(0) if detail >= DiffDetailHunks { intHunks = C.int(1) } intLines := C...
[ "func", "DiffBlobs", "(", "oldBlob", "*", "Blob", ",", "oldAsPath", "string", ",", "newBlob", "*", "Blob", ",", "newAsPath", "string", ",", "opts", "*", "DiffOptions", ",", "fileCallback", "DiffForEachFileCallback", ",", "detail", "DiffDetail", ")", "error", "...
// DiffBlobs performs a diff between two arbitrary blobs. You can pass // whatever file names you'd like for them to appear as in the diff.
[ "DiffBlobs", "performs", "a", "diff", "between", "two", "arbitrary", "blobs", ".", "You", "can", "pass", "whatever", "file", "names", "you", "d", "like", "for", "them", "to", "appear", "as", "in", "the", "diff", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/diff.go#L765-L810
29,124
libgit2/git2go
rebase.go
DefaultRebaseOptions
func DefaultRebaseOptions() (RebaseOptions, error) { opts := C.git_rebase_options{} runtime.LockOSThread() defer runtime.UnlockOSThread() ecode := C.git_rebase_init_options(&opts, C.GIT_REBASE_OPTIONS_VERSION) if ecode < 0 { return RebaseOptions{}, MakeGitError(ecode) } return rebaseOptionsFromC(&opts), nil ...
go
func DefaultRebaseOptions() (RebaseOptions, error) { opts := C.git_rebase_options{} runtime.LockOSThread() defer runtime.UnlockOSThread() ecode := C.git_rebase_init_options(&opts, C.GIT_REBASE_OPTIONS_VERSION) if ecode < 0 { return RebaseOptions{}, MakeGitError(ecode) } return rebaseOptionsFromC(&opts), nil ...
[ "func", "DefaultRebaseOptions", "(", ")", "(", "RebaseOptions", ",", "error", ")", "{", "opts", ":=", "C", ".", "git_rebase_options", "{", "}", "\n\n", "runtime", ".", "LockOSThread", "(", ")", "\n", "defer", "runtime", ".", "UnlockOSThread", "(", ")", "\n...
// DefaultRebaseOptions returns a RebaseOptions with default values.
[ "DefaultRebaseOptions", "returns", "a", "RebaseOptions", "with", "default", "values", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/rebase.go#L83-L94
29,125
libgit2/git2go
rebase.go
InitRebase
func (r *Repository) InitRebase(branch *AnnotatedCommit, upstream *AnnotatedCommit, onto *AnnotatedCommit, opts *RebaseOptions) (*Rebase, error) { runtime.LockOSThread() defer runtime.UnlockOSThread() if branch == nil { branch = &AnnotatedCommit{ptr: nil} } if upstream == nil { upstream = &AnnotatedCommit{pt...
go
func (r *Repository) InitRebase(branch *AnnotatedCommit, upstream *AnnotatedCommit, onto *AnnotatedCommit, opts *RebaseOptions) (*Rebase, error) { runtime.LockOSThread() defer runtime.UnlockOSThread() if branch == nil { branch = &AnnotatedCommit{ptr: nil} } if upstream == nil { upstream = &AnnotatedCommit{pt...
[ "func", "(", "r", "*", "Repository", ")", "InitRebase", "(", "branch", "*", "AnnotatedCommit", ",", "upstream", "*", "AnnotatedCommit", ",", "onto", "*", "AnnotatedCommit", ",", "opts", "*", "RebaseOptions", ")", "(", "*", "Rebase", ",", "error", ")", "{",...
// InitRebase initializes a rebase operation to rebase the changes in branch relative to upstream onto another branch.
[ "InitRebase", "initializes", "a", "rebase", "operation", "to", "rebase", "the", "changes", "in", "branch", "relative", "to", "upstream", "onto", "another", "branch", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/rebase.go#L135-L161
29,126
libgit2/git2go
rebase.go
OpenRebase
func (r *Repository) OpenRebase(opts *RebaseOptions) (*Rebase, error) { runtime.LockOSThread() defer runtime.UnlockOSThread() var ptr *C.git_rebase err := C.git_rebase_open(&ptr, r.ptr, opts.toC()) runtime.KeepAlive(r) if err < 0 { return nil, MakeGitError(err) } return newRebaseFromC(ptr), nil }
go
func (r *Repository) OpenRebase(opts *RebaseOptions) (*Rebase, error) { runtime.LockOSThread() defer runtime.UnlockOSThread() var ptr *C.git_rebase err := C.git_rebase_open(&ptr, r.ptr, opts.toC()) runtime.KeepAlive(r) if err < 0 { return nil, MakeGitError(err) } return newRebaseFromC(ptr), nil }
[ "func", "(", "r", "*", "Repository", ")", "OpenRebase", "(", "opts", "*", "RebaseOptions", ")", "(", "*", "Rebase", ",", "error", ")", "{", "runtime", ".", "LockOSThread", "(", ")", "\n", "defer", "runtime", ".", "UnlockOSThread", "(", ")", "\n\n", "va...
// OpenRebase opens an existing rebase that was previously started by either an invocation of InitRebase or by another client.
[ "OpenRebase", "opens", "an", "existing", "rebase", "that", "was", "previously", "started", "by", "either", "an", "invocation", "of", "InitRebase", "or", "by", "another", "client", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/rebase.go#L164-L176
29,127
libgit2/git2go
rebase.go
OperationAt
func (rebase *Rebase) OperationAt(index uint) *RebaseOperation { operation := C.git_rebase_operation_byindex(rebase.ptr, C.size_t(index)) return newRebaseOperationFromC(operation) }
go
func (rebase *Rebase) OperationAt(index uint) *RebaseOperation { operation := C.git_rebase_operation_byindex(rebase.ptr, C.size_t(index)) return newRebaseOperationFromC(operation) }
[ "func", "(", "rebase", "*", "Rebase", ")", "OperationAt", "(", "index", "uint", ")", "*", "RebaseOperation", "{", "operation", ":=", "C", ".", "git_rebase_operation_byindex", "(", "rebase", ".", "ptr", ",", "C", ".", "size_t", "(", "index", ")", ")", "\n...
// OperationAt gets the rebase operation specified by the given index.
[ "OperationAt", "gets", "the", "rebase", "operation", "specified", "by", "the", "given", "index", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/rebase.go#L179-L183
29,128
libgit2/git2go
rebase.go
CurrentOperationIndex
func (rebase *Rebase) CurrentOperationIndex() (uint, error) { runtime.LockOSThread() defer runtime.UnlockOSThread() var err error operationIndex := uint(C.git_rebase_operation_current(rebase.ptr)) runtime.KeepAlive(rebase) if operationIndex == RebaseNoOperation { err = ErrRebaseNoOperation } return uint(ope...
go
func (rebase *Rebase) CurrentOperationIndex() (uint, error) { runtime.LockOSThread() defer runtime.UnlockOSThread() var err error operationIndex := uint(C.git_rebase_operation_current(rebase.ptr)) runtime.KeepAlive(rebase) if operationIndex == RebaseNoOperation { err = ErrRebaseNoOperation } return uint(ope...
[ "func", "(", "rebase", "*", "Rebase", ")", "CurrentOperationIndex", "(", ")", "(", "uint", ",", "error", ")", "{", "runtime", ".", "LockOSThread", "(", ")", "\n", "defer", "runtime", ".", "UnlockOSThread", "(", ")", "\n\n", "var", "err", "error", "\n", ...
// CurrentOperationIndex gets the index of the rebase operation that is // currently being applied. There is also an error returned for API // compatibility.
[ "CurrentOperationIndex", "gets", "the", "index", "of", "the", "rebase", "operation", "that", "is", "currently", "being", "applied", ".", "There", "is", "also", "an", "error", "returned", "for", "API", "compatibility", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/rebase.go#L188-L200
29,129
libgit2/git2go
rebase.go
OperationCount
func (rebase *Rebase) OperationCount() uint { ret := uint(C.git_rebase_operation_entrycount(rebase.ptr)) runtime.KeepAlive(rebase) return ret }
go
func (rebase *Rebase) OperationCount() uint { ret := uint(C.git_rebase_operation_entrycount(rebase.ptr)) runtime.KeepAlive(rebase) return ret }
[ "func", "(", "rebase", "*", "Rebase", ")", "OperationCount", "(", ")", "uint", "{", "ret", ":=", "uint", "(", "C", ".", "git_rebase_operation_entrycount", "(", "rebase", ".", "ptr", ")", ")", "\n", "runtime", ".", "KeepAlive", "(", "rebase", ")", "\n", ...
// OperationCount gets the count of rebase operations that are to be applied.
[ "OperationCount", "gets", "the", "count", "of", "rebase", "operations", "that", "are", "to", "be", "applied", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/rebase.go#L203-L207
29,130
libgit2/git2go
rebase.go
Finish
func (rebase *Rebase) Finish() error { runtime.LockOSThread() defer runtime.UnlockOSThread() err := C.git_rebase_finish(rebase.ptr, nil) runtime.KeepAlive(rebase) if err < 0 { return MakeGitError(err) } return nil }
go
func (rebase *Rebase) Finish() error { runtime.LockOSThread() defer runtime.UnlockOSThread() err := C.git_rebase_finish(rebase.ptr, nil) runtime.KeepAlive(rebase) if err < 0 { return MakeGitError(err) } return nil }
[ "func", "(", "rebase", "*", "Rebase", ")", "Finish", "(", ")", "error", "{", "runtime", ".", "LockOSThread", "(", ")", "\n", "defer", "runtime", ".", "UnlockOSThread", "(", ")", "\n\n", "err", ":=", "C", ".", "git_rebase_finish", "(", "rebase", ".", "p...
// Finish finishes a rebase that is currently in progress once all patches have been applied.
[ "Finish", "finishes", "a", "rebase", "that", "is", "currently", "in", "progress", "once", "all", "patches", "have", "been", "applied", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/rebase.go#L259-L270
29,131
libgit2/git2go
rebase.go
Abort
func (rebase *Rebase) Abort() error { runtime.LockOSThread() defer runtime.UnlockOSThread() err := C.git_rebase_abort(rebase.ptr) runtime.KeepAlive(rebase) if err < 0 { return MakeGitError(err) } return nil }
go
func (rebase *Rebase) Abort() error { runtime.LockOSThread() defer runtime.UnlockOSThread() err := C.git_rebase_abort(rebase.ptr) runtime.KeepAlive(rebase) if err < 0 { return MakeGitError(err) } return nil }
[ "func", "(", "rebase", "*", "Rebase", ")", "Abort", "(", ")", "error", "{", "runtime", ".", "LockOSThread", "(", ")", "\n", "defer", "runtime", ".", "UnlockOSThread", "(", ")", "\n\n", "err", ":=", "C", ".", "git_rebase_abort", "(", "rebase", ".", "ptr...
// Abort aborts a rebase that is currently in progress, resetting the repository and working directory to their state before rebase began.
[ "Abort", "aborts", "a", "rebase", "that", "is", "currently", "in", "progress", "resetting", "the", "repository", "and", "working", "directory", "to", "their", "state", "before", "rebase", "began", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/rebase.go#L273-L283
29,132
libgit2/git2go
rebase.go
Free
func (rebase *Rebase) Free() { runtime.SetFinalizer(rebase, nil) C.git_rebase_free(rebase.ptr) }
go
func (rebase *Rebase) Free() { runtime.SetFinalizer(rebase, nil) C.git_rebase_free(rebase.ptr) }
[ "func", "(", "rebase", "*", "Rebase", ")", "Free", "(", ")", "{", "runtime", ".", "SetFinalizer", "(", "rebase", ",", "nil", ")", "\n", "C", ".", "git_rebase_free", "(", "rebase", ".", "ptr", ")", "\n", "}" ]
// Free frees the Rebase object.
[ "Free", "frees", "the", "Rebase", "object", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/rebase.go#L286-L289
29,133
libgit2/git2go
mempack.go
NewMempack
func NewMempack(odb *Odb) (mempack *Mempack, err error) { mempack = new(Mempack) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_mempack_new(&mempack.ptr) if ret < 0 { return nil, MakeGitError(ret) } ret = C.git_odb_add_backend(odb.ptr, mempack.ptr, C.int(999)) runtime.KeepAlive(odb) if...
go
func NewMempack(odb *Odb) (mempack *Mempack, err error) { mempack = new(Mempack) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_mempack_new(&mempack.ptr) if ret < 0 { return nil, MakeGitError(ret) } ret = C.git_odb_add_backend(odb.ptr, mempack.ptr, C.int(999)) runtime.KeepAlive(odb) if...
[ "func", "NewMempack", "(", "odb", "*", "Odb", ")", "(", "mempack", "*", "Mempack", ",", "err", "error", ")", "{", "mempack", "=", "new", "(", "Mempack", ")", "\n\n", "runtime", ".", "LockOSThread", "(", ")", "\n", "defer", "runtime", ".", "UnlockOSThre...
// NewMempack creates a new mempack instance and registers it to the ODB.
[ "NewMempack", "creates", "a", "new", "mempack", "instance", "and", "registers", "it", "to", "the", "ODB", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/mempack.go#L25-L47
29,134
libgit2/git2go
remote.go
Fetch
func (o *Remote) Fetch(refspecs []string, opts *FetchOptions, msg string) error { var cmsg *C.char = nil if msg != "" { cmsg = C.CString(msg) defer C.free(unsafe.Pointer(cmsg)) } crefspecs := C.git_strarray{} crefspecs.count = C.size_t(len(refspecs)) crefspecs.strings = makeCStringsFromStrings(refspecs) def...
go
func (o *Remote) Fetch(refspecs []string, opts *FetchOptions, msg string) error { var cmsg *C.char = nil if msg != "" { cmsg = C.CString(msg) defer C.free(unsafe.Pointer(cmsg)) } crefspecs := C.git_strarray{} crefspecs.count = C.size_t(len(refspecs)) crefspecs.strings = makeCStringsFromStrings(refspecs) def...
[ "func", "(", "o", "*", "Remote", ")", "Fetch", "(", "refspecs", "[", "]", "string", ",", "opts", "*", "FetchOptions", ",", "msg", "string", ")", "error", "{", "var", "cmsg", "*", "C", ".", "char", "=", "nil", "\n", "if", "msg", "!=", "\"", "\"", ...
// Fetch performs a fetch operation. refspecs specifies which refspecs // to use for this fetch, use an empty list to use the refspecs from // the configuration; msg specifies what to use for the reflog // entries. Leave "" to use defaults.
[ "Fetch", "performs", "a", "fetch", "operation", ".", "refspecs", "specifies", "which", "refspecs", "to", "use", "for", "this", "fetch", "use", "an", "empty", "list", "to", "use", "the", "refspecs", "from", "the", "configuration", ";", "msg", "specifies", "wh...
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/remote.go#L706-L734
29,135
libgit2/git2go
signature.go
Offset
func (v *Signature) Offset() int { _, offset := v.When.Zone() return offset / 60 }
go
func (v *Signature) Offset() int { _, offset := v.When.Zone() return offset / 60 }
[ "func", "(", "v", "*", "Signature", ")", "Offset", "(", ")", "int", "{", "_", ",", "offset", ":=", "v", ".", "When", ".", "Zone", "(", ")", "\n", "return", "offset", "/", "60", "\n", "}" ]
// Offset returns the time zone offset of v.When in minutes, which is what git wants.
[ "Offset", "returns", "the", "time", "zone", "offset", "of", "v", ".", "When", "in", "minutes", "which", "is", "what", "git", "wants", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/signature.go#L30-L33
29,136
libgit2/git2go
stash.go
Save
func (c *StashCollection) Save( stasher *Signature, message string, flags StashFlag) (*Oid, error) { oid := new(Oid) stasherC, err := stasher.toC() if err != nil { return nil, err } defer C.git_signature_free(stasherC) messageC := C.CString(message) defer C.free(unsafe.Pointer(messageC)) runtime.LockOSTh...
go
func (c *StashCollection) Save( stasher *Signature, message string, flags StashFlag) (*Oid, error) { oid := new(Oid) stasherC, err := stasher.toC() if err != nil { return nil, err } defer C.git_signature_free(stasherC) messageC := C.CString(message) defer C.free(unsafe.Pointer(messageC)) runtime.LockOSTh...
[ "func", "(", "c", "*", "StashCollection", ")", "Save", "(", "stasher", "*", "Signature", ",", "message", "string", ",", "flags", "StashFlag", ")", "(", "*", "Oid", ",", "error", ")", "{", "oid", ":=", "new", "(", "Oid", ")", "\n\n", "stasherC", ",", ...
// Save saves the local modifications to a new stash. // // Stasher is the identity of the person performing the stashing. // Message is the optional description along with the stashed state. // Flags control the stashing process and are given as bitwise OR.
[ "Save", "saves", "the", "local", "modifications", "to", "a", "new", "stash", ".", "Stasher", "is", "the", "identity", "of", "the", "person", "performing", "the", "stashing", ".", "Message", "is", "the", "optional", "description", "along", "with", "the", "sta...
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/stash.go#L46-L71
29,137
libgit2/git2go
stash.go
DefaultStashApplyOptions
func DefaultStashApplyOptions() (StashApplyOptions, error) { optsC := C.git_stash_apply_options{} runtime.LockOSThread() defer runtime.UnlockOSThread() ecode := C.git_stash_apply_init_options(&optsC, C.GIT_STASH_APPLY_OPTIONS_VERSION) if ecode < 0 { return StashApplyOptions{}, MakeGitError(ecode) } return St...
go
func DefaultStashApplyOptions() (StashApplyOptions, error) { optsC := C.git_stash_apply_options{} runtime.LockOSThread() defer runtime.UnlockOSThread() ecode := C.git_stash_apply_init_options(&optsC, C.GIT_STASH_APPLY_OPTIONS_VERSION) if ecode < 0 { return StashApplyOptions{}, MakeGitError(ecode) } return St...
[ "func", "DefaultStashApplyOptions", "(", ")", "(", "StashApplyOptions", ",", "error", ")", "{", "optsC", ":=", "C", ".", "git_stash_apply_options", "{", "}", "\n\n", "runtime", ".", "LockOSThread", "(", ")", "\n", "defer", "runtime", ".", "UnlockOSThread", "("...
// DefaultStashApplyOptions initializes the structure with default values.
[ "DefaultStashApplyOptions", "initializes", "the", "structure", "with", "default", "values", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/stash.go#L148-L162
29,138
libgit2/git2go
stash.go
Foreach
func (c *StashCollection) Foreach(callback StashCallback) error { data := stashCallbackData{ Callback: callback, } handle := pointerHandles.Track(&data) defer pointerHandles.Untrack(handle) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C._go_git_stash_foreach(c.repo.ptr, handle) runtime.Keep...
go
func (c *StashCollection) Foreach(callback StashCallback) error { data := stashCallbackData{ Callback: callback, } handle := pointerHandles.Track(&data) defer pointerHandles.Untrack(handle) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C._go_git_stash_foreach(c.repo.ptr, handle) runtime.Keep...
[ "func", "(", "c", "*", "StashCollection", ")", "Foreach", "(", "callback", "StashCallback", ")", "error", "{", "data", ":=", "stashCallbackData", "{", "Callback", ":", "callback", ",", "}", "\n\n", "handle", ":=", "pointerHandles", ".", "Track", "(", "&", ...
// Foreach loops over all the stashed states and calls the callback // for each one. // // If callback returns an error, this will stop looping.
[ "Foreach", "loops", "over", "all", "the", "stashed", "states", "and", "calls", "the", "callback", "for", "each", "one", ".", "If", "callback", "returns", "an", "error", "this", "will", "stop", "looping", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/stash.go#L274-L294
29,139
libgit2/git2go
stash.go
Drop
func (c *StashCollection) Drop(index int) error { runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_stash_drop(c.repo.ptr, C.size_t(index)) runtime.KeepAlive(c) if ret < 0 { return MakeGitError(ret) } return nil }
go
func (c *StashCollection) Drop(index int) error { runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_stash_drop(c.repo.ptr, C.size_t(index)) runtime.KeepAlive(c) if ret < 0 { return MakeGitError(ret) } return nil }
[ "func", "(", "c", "*", "StashCollection", ")", "Drop", "(", "index", "int", ")", "error", "{", "runtime", ".", "LockOSThread", "(", ")", "\n", "defer", "runtime", ".", "UnlockOSThread", "(", ")", "\n\n", "ret", ":=", "C", ".", "git_stash_drop", "(", "c...
// Drop removes a single stashed state from the stash list. // // 'index' is the position within the stash list. 0 points // to the most recent stashed state. // // Returns error code ErrNotFound if there's no stashed // state for the given index.
[ "Drop", "removes", "a", "single", "stashed", "state", "from", "the", "stash", "list", ".", "index", "is", "the", "position", "within", "the", "stash", "list", ".", "0", "points", "to", "the", "most", "recent", "stashed", "state", ".", "Returns", "error", ...
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/stash.go#L303-L313
29,140
libgit2/git2go
handles.go
Track
func (v *HandleList) Track(pointer interface{}) unsafe.Pointer { handle := C.malloc(1) v.Lock() v.handles[handle] = pointer v.Unlock() return handle }
go
func (v *HandleList) Track(pointer interface{}) unsafe.Pointer { handle := C.malloc(1) v.Lock() v.handles[handle] = pointer v.Unlock() return handle }
[ "func", "(", "v", "*", "HandleList", ")", "Track", "(", "pointer", "interface", "{", "}", ")", "unsafe", ".", "Pointer", "{", "handle", ":=", "C", ".", "malloc", "(", "1", ")", "\n\n", "v", ".", "Lock", "(", ")", "\n", "v", ".", "handles", "[", ...
// Track adds the given pointer to the list of pointers to track and // returns a pointer value which can be passed to C as an opaque // pointer.
[ "Track", "adds", "the", "given", "pointer", "to", "the", "list", "of", "pointers", "to", "track", "and", "returns", "a", "pointer", "value", "which", "can", "be", "passed", "to", "C", "as", "an", "opaque", "pointer", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/handles.go#L28-L36
29,141
libgit2/git2go
handles.go
Untrack
func (v *HandleList) Untrack(handle unsafe.Pointer) { v.Lock() delete(v.handles, handle) C.free(handle) v.Unlock() }
go
func (v *HandleList) Untrack(handle unsafe.Pointer) { v.Lock() delete(v.handles, handle) C.free(handle) v.Unlock() }
[ "func", "(", "v", "*", "HandleList", ")", "Untrack", "(", "handle", "unsafe", ".", "Pointer", ")", "{", "v", ".", "Lock", "(", ")", "\n", "delete", "(", "v", ".", "handles", ",", "handle", ")", "\n", "C", ".", "free", "(", "handle", ")", "\n", ...
// Untrack stops tracking the pointer given by the handle
[ "Untrack", "stops", "tracking", "the", "pointer", "given", "by", "the", "handle" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/handles.go#L39-L44
29,142
libgit2/git2go
handles.go
Get
func (v *HandleList) Get(handle unsafe.Pointer) interface{} { v.RLock() defer v.RUnlock() ptr, ok := v.handles[handle] if !ok { panic(fmt.Sprintf("invalid pointer handle: %p", handle)) } return ptr }
go
func (v *HandleList) Get(handle unsafe.Pointer) interface{} { v.RLock() defer v.RUnlock() ptr, ok := v.handles[handle] if !ok { panic(fmt.Sprintf("invalid pointer handle: %p", handle)) } return ptr }
[ "func", "(", "v", "*", "HandleList", ")", "Get", "(", "handle", "unsafe", ".", "Pointer", ")", "interface", "{", "}", "{", "v", ".", "RLock", "(", ")", "\n", "defer", "v", ".", "RUnlock", "(", ")", "\n\n", "ptr", ",", "ok", ":=", "v", ".", "han...
// Get retrieves the pointer from the given handle
[ "Get", "retrieves", "the", "pointer", "from", "the", "given", "handle" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/handles.go#L47-L57
29,143
libgit2/git2go
index.go
NewIndex
func NewIndex() (*Index, error) { var ptr *C.git_index runtime.LockOSThread() defer runtime.UnlockOSThread() if err := C.git_index_new(&ptr); err < 0 { return nil, MakeGitError(err) } return newIndexFromC(ptr, nil), nil }
go
func NewIndex() (*Index, error) { var ptr *C.git_index runtime.LockOSThread() defer runtime.UnlockOSThread() if err := C.git_index_new(&ptr); err < 0 { return nil, MakeGitError(err) } return newIndexFromC(ptr, nil), nil }
[ "func", "NewIndex", "(", ")", "(", "*", "Index", ",", "error", ")", "{", "var", "ptr", "*", "C", ".", "git_index", "\n\n", "runtime", ".", "LockOSThread", "(", ")", "\n", "defer", "runtime", ".", "UnlockOSThread", "(", ")", "\n\n", "if", "err", ":=",...
// NewIndex allocates a new index. It won't be associated with any // file on the filesystem or repository
[ "NewIndex", "allocates", "a", "new", "index", ".", "It", "won", "t", "be", "associated", "with", "any", "file", "on", "the", "filesystem", "or", "repository" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/index.go#L109-L120
29,144
libgit2/git2go
index.go
Path
func (v *Index) Path() string { ret := C.GoString(C.git_index_path(v.ptr)) runtime.KeepAlive(v) return ret }
go
func (v *Index) Path() string { ret := C.GoString(C.git_index_path(v.ptr)) runtime.KeepAlive(v) return ret }
[ "func", "(", "v", "*", "Index", ")", "Path", "(", ")", "string", "{", "ret", ":=", "C", ".", "GoString", "(", "C", ".", "git_index_path", "(", "v", ".", "ptr", ")", ")", "\n", "runtime", ".", "KeepAlive", "(", "v", ")", "\n", "return", "ret", "...
// Path returns the index' path on disk or an empty string if it // exists only in memory.
[ "Path", "returns", "the", "index", "path", "on", "disk", "or", "an", "empty", "string", "if", "it", "exists", "only", "in", "memory", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/index.go#L142-L146
29,145
libgit2/git2go
index.go
Clear
func (v *Index) Clear() error { runtime.LockOSThread() defer runtime.UnlockOSThread() err := C.git_index_clear(v.ptr) runtime.KeepAlive(v) if err < 0 { return MakeGitError(err) } return nil }
go
func (v *Index) Clear() error { runtime.LockOSThread() defer runtime.UnlockOSThread() err := C.git_index_clear(v.ptr) runtime.KeepAlive(v) if err < 0 { return MakeGitError(err) } return nil }
[ "func", "(", "v", "*", "Index", ")", "Clear", "(", ")", "error", "{", "runtime", ".", "LockOSThread", "(", ")", "\n", "defer", "runtime", ".", "UnlockOSThread", "(", ")", "\n\n", "err", ":=", "C", ".", "git_index_clear", "(", "v", ".", "ptr", ")", ...
// Clear clears the index object in memory; changes must be explicitly // written to disk for them to take effect persistently
[ "Clear", "clears", "the", "index", "object", "in", "memory", ";", "changes", "must", "be", "explicitly", "written", "to", "disk", "for", "them", "to", "take", "effect", "persistently" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/index.go#L150-L160
29,146
libgit2/git2go
index.go
Add
func (v *Index) Add(entry *IndexEntry) error { var centry C.git_index_entry populateCIndexEntry(entry, &centry) defer freeCIndexEntry(&centry) runtime.LockOSThread() defer runtime.UnlockOSThread() err := C.git_index_add(v.ptr, &centry) runtime.KeepAlive(v) if err < 0 { return MakeGitError(err) } return ...
go
func (v *Index) Add(entry *IndexEntry) error { var centry C.git_index_entry populateCIndexEntry(entry, &centry) defer freeCIndexEntry(&centry) runtime.LockOSThread() defer runtime.UnlockOSThread() err := C.git_index_add(v.ptr, &centry) runtime.KeepAlive(v) if err < 0 { return MakeGitError(err) } return ...
[ "func", "(", "v", "*", "Index", ")", "Add", "(", "entry", "*", "IndexEntry", ")", "error", "{", "var", "centry", "C", ".", "git_index_entry", "\n\n", "populateCIndexEntry", "(", "entry", ",", "&", "centry", ")", "\n", "defer", "freeCIndexEntry", "(", "&"...
// Add adds or replaces the given entry to the index, making a copy of // the data
[ "Add", "adds", "or", "replaces", "the", "given", "entry", "to", "the", "index", "making", "a", "copy", "of", "the", "data" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/index.go#L164-L180
29,147
libgit2/git2go
index.go
RemoveDirectory
func (v *Index) RemoveDirectory(dir string, stage int) error { cstr := C.CString(dir) defer C.free(unsafe.Pointer(cstr)) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_index_remove_directory(v.ptr, cstr, C.int(stage)) runtime.KeepAlive(v) if ret < 0 { return MakeGitError(ret) } return ...
go
func (v *Index) RemoveDirectory(dir string, stage int) error { cstr := C.CString(dir) defer C.free(unsafe.Pointer(cstr)) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_index_remove_directory(v.ptr, cstr, C.int(stage)) runtime.KeepAlive(v) if ret < 0 { return MakeGitError(ret) } return ...
[ "func", "(", "v", "*", "Index", ")", "RemoveDirectory", "(", "dir", "string", ",", "stage", "int", ")", "error", "{", "cstr", ":=", "C", ".", "CString", "(", "dir", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cstr", ...
// RemoveDirectory removes all entries from the index under a given directory.
[ "RemoveDirectory", "removes", "all", "entries", "from", "the", "index", "under", "a", "given", "directory", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/index.go#L306-L320
29,148
libgit2/git2go
index.go
ReadTree
func (v *Index) ReadTree(tree *Tree) error { runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_index_read_tree(v.ptr, tree.cast_ptr) runtime.KeepAlive(v) runtime.KeepAlive(tree) if ret < 0 { return MakeGitError(ret) } return nil }
go
func (v *Index) ReadTree(tree *Tree) error { runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_index_read_tree(v.ptr, tree.cast_ptr) runtime.KeepAlive(v) runtime.KeepAlive(tree) if ret < 0 { return MakeGitError(ret) } return nil }
[ "func", "(", "v", "*", "Index", ")", "ReadTree", "(", "tree", "*", "Tree", ")", "error", "{", "runtime", ".", "LockOSThread", "(", ")", "\n", "defer", "runtime", ".", "UnlockOSThread", "(", ")", "\n\n", "ret", ":=", "C", ".", "git_index_read_tree", "("...
// ReadTree replaces the contents of the index with those of the given // tree
[ "ReadTree", "replaces", "the", "contents", "of", "the", "index", "with", "those", "of", "the", "given", "tree" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/index.go#L340-L352
29,149
libgit2/git2go
describe.go
DefaultDescribeOptions
func DefaultDescribeOptions() (DescribeOptions, error) { runtime.LockOSThread() defer runtime.UnlockOSThread() opts := C.git_describe_options{} ecode := C.git_describe_init_options(&opts, C.GIT_DESCRIBE_OPTIONS_VERSION) if ecode < 0 { return DescribeOptions{}, MakeGitError(ecode) } return DescribeOptions{ ...
go
func DefaultDescribeOptions() (DescribeOptions, error) { runtime.LockOSThread() defer runtime.UnlockOSThread() opts := C.git_describe_options{} ecode := C.git_describe_init_options(&opts, C.GIT_DESCRIBE_OPTIONS_VERSION) if ecode < 0 { return DescribeOptions{}, MakeGitError(ecode) } return DescribeOptions{ ...
[ "func", "DefaultDescribeOptions", "(", ")", "(", "DescribeOptions", ",", "error", ")", "{", "runtime", ".", "LockOSThread", "(", ")", "\n", "defer", "runtime", ".", "UnlockOSThread", "(", ")", "\n\n", "opts", ":=", "C", ".", "git_describe_options", "{", "}",...
// DefaultDescribeOptions returns default options for the describe operation.
[ "DefaultDescribeOptions", "returns", "default", "options", "for", "the", "describe", "operation", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/describe.go#L41-L55
29,150
libgit2/git2go
describe.go
DefaultDescribeFormatOptions
func DefaultDescribeFormatOptions() (DescribeFormatOptions, error) { runtime.LockOSThread() defer runtime.UnlockOSThread() opts := C.git_describe_format_options{} ecode := C.git_describe_init_format_options(&opts, C.GIT_DESCRIBE_FORMAT_OPTIONS_VERSION) if ecode < 0 { return DescribeFormatOptions{}, MakeGitError...
go
func DefaultDescribeFormatOptions() (DescribeFormatOptions, error) { runtime.LockOSThread() defer runtime.UnlockOSThread() opts := C.git_describe_format_options{} ecode := C.git_describe_init_format_options(&opts, C.GIT_DESCRIBE_FORMAT_OPTIONS_VERSION) if ecode < 0 { return DescribeFormatOptions{}, MakeGitError...
[ "func", "DefaultDescribeFormatOptions", "(", ")", "(", "DescribeFormatOptions", ",", "error", ")", "{", "runtime", ".", "LockOSThread", "(", ")", "\n", "defer", "runtime", ".", "UnlockOSThread", "(", ")", "\n\n", "opts", ":=", "C", ".", "git_describe_format_opti...
// DefaultDescribeFormatOptions returns default options for formatting // the output.
[ "DefaultDescribeFormatOptions", "returns", "default", "options", "for", "formatting", "the", "output", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/describe.go#L75-L89
29,151
libgit2/git2go
describe.go
Format
func (result *DescribeResult) Format(opts *DescribeFormatOptions) (string, error) { resultBuf := C.git_buf{} var cFormatOpts *C.git_describe_format_options if opts != nil { cDirtySuffix := C.CString(opts.DirtySuffix) defer C.free(unsafe.Pointer(cDirtySuffix)) cFormatOpts = &C.git_describe_format_options{ ...
go
func (result *DescribeResult) Format(opts *DescribeFormatOptions) (string, error) { resultBuf := C.git_buf{} var cFormatOpts *C.git_describe_format_options if opts != nil { cDirtySuffix := C.CString(opts.DirtySuffix) defer C.free(unsafe.Pointer(cDirtySuffix)) cFormatOpts = &C.git_describe_format_options{ ...
[ "func", "(", "result", "*", "DescribeResult", ")", "Format", "(", "opts", "*", "DescribeFormatOptions", ")", "(", "string", ",", "error", ")", "{", "resultBuf", ":=", "C", ".", "git_buf", "{", "}", "\n\n", "var", "cFormatOpts", "*", "C", ".", "git_descri...
// Format prints the DescribeResult as a string.
[ "Format", "prints", "the", "DescribeResult", "as", "a", "string", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/describe.go#L191-L218
29,152
libgit2/git2go
describe.go
Free
func (result *DescribeResult) Free() { runtime.SetFinalizer(result, nil) C.git_describe_result_free(result.ptr) result.ptr = nil }
go
func (result *DescribeResult) Free() { runtime.SetFinalizer(result, nil) C.git_describe_result_free(result.ptr) result.ptr = nil }
[ "func", "(", "result", "*", "DescribeResult", ")", "Free", "(", ")", "{", "runtime", ".", "SetFinalizer", "(", "result", ",", "nil", ")", "\n", "C", ".", "git_describe_result_free", "(", "result", ".", "ptr", ")", "\n", "result", ".", "ptr", "=", "nil"...
// Free cleans up the C reference.
[ "Free", "cleans", "up", "the", "C", "reference", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/describe.go#L221-L225
29,153
libgit2/git2go
tag.go
Foreach
func (c *TagsCollection) Foreach(callback TagForeachCallback) error { data := tagForeachData{ callback: callback, err: nil, } handle := pointerHandles.Track(&data) defer pointerHandles.Untrack(handle) runtime.LockOSThread() defer runtime.UnlockOSThread() err := C._go_git_tag_foreach(c.repo.ptr, handl...
go
func (c *TagsCollection) Foreach(callback TagForeachCallback) error { data := tagForeachData{ callback: callback, err: nil, } handle := pointerHandles.Track(&data) defer pointerHandles.Untrack(handle) runtime.LockOSThread() defer runtime.UnlockOSThread() err := C._go_git_tag_foreach(c.repo.ptr, handl...
[ "func", "(", "c", "*", "TagsCollection", ")", "Foreach", "(", "callback", "TagForeachCallback", ")", "error", "{", "data", ":=", "tagForeachData", "{", "callback", ":", "callback", ",", "err", ":", "nil", ",", "}", "\n\n", "handle", ":=", "pointerHandles", ...
// Foreach calls the callback for each tag in the repository.
[ "Foreach", "calls", "the", "callback", "for", "each", "tag", "in", "the", "repository", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/tag.go#L223-L245
29,154
libgit2/git2go
reference.go
EnsureLog
func (c *ReferenceCollection) EnsureLog(name string) error { cname := C.CString(name) defer C.free(unsafe.Pointer(cname)) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_reference_ensure_log(c.repo.ptr, cname) runtime.KeepAlive(c) if ret < 0 { return MakeGitError(ret) } return nil }
go
func (c *ReferenceCollection) EnsureLog(name string) error { cname := C.CString(name) defer C.free(unsafe.Pointer(cname)) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_reference_ensure_log(c.repo.ptr, cname) runtime.KeepAlive(c) if ret < 0 { return MakeGitError(ret) } return nil }
[ "func", "(", "c", "*", "ReferenceCollection", ")", "EnsureLog", "(", "name", "string", ")", "error", "{", "cname", ":=", "C", ".", "CString", "(", "name", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cname", ")", ")", ...
// EnsureLog ensures that there is a reflog for the given reference // name and creates an empty one if necessary.
[ "EnsureLog", "ensures", "that", "there", "is", "a", "reflog", "for", "the", "given", "reference", "name", "and", "creates", "an", "empty", "one", "if", "necessary", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/reference.go#L103-L117
29,155
libgit2/git2go
reference.go
HasLog
func (c *ReferenceCollection) HasLog(name string) (bool, error) { cname := C.CString(name) defer C.free(unsafe.Pointer(cname)) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_reference_has_log(c.repo.ptr, cname) runtime.KeepAlive(c) if ret < 0 { return false, MakeGitError(ret) } return ...
go
func (c *ReferenceCollection) HasLog(name string) (bool, error) { cname := C.CString(name) defer C.free(unsafe.Pointer(cname)) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_reference_has_log(c.repo.ptr, cname) runtime.KeepAlive(c) if ret < 0 { return false, MakeGitError(ret) } return ...
[ "func", "(", "c", "*", "ReferenceCollection", ")", "HasLog", "(", "name", "string", ")", "(", "bool", ",", "error", ")", "{", "cname", ":=", "C", ".", "CString", "(", "name", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(",...
// HasLog returns whether there is a reflog for the given reference // name
[ "HasLog", "returns", "whether", "there", "is", "a", "reflog", "for", "the", "given", "reference", "name" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/reference.go#L121-L135
29,156
libgit2/git2go
reference.go
Dwim
func (c *ReferenceCollection) Dwim(name string) (*Reference, error) { cname := C.CString(name) defer C.free(unsafe.Pointer(cname)) runtime.LockOSThread() defer runtime.UnlockOSThread() var ptr *C.git_reference ret := C.git_reference_dwim(&ptr, c.repo.ptr, cname) runtime.KeepAlive(c) if ret < 0 { return nil,...
go
func (c *ReferenceCollection) Dwim(name string) (*Reference, error) { cname := C.CString(name) defer C.free(unsafe.Pointer(cname)) runtime.LockOSThread() defer runtime.UnlockOSThread() var ptr *C.git_reference ret := C.git_reference_dwim(&ptr, c.repo.ptr, cname) runtime.KeepAlive(c) if ret < 0 { return nil,...
[ "func", "(", "c", "*", "ReferenceCollection", ")", "Dwim", "(", "name", "string", ")", "(", "*", "Reference", ",", "error", ")", "{", "cname", ":=", "C", ".", "CString", "(", "name", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointe...
// Dwim looks up a reference by DWIMing its short name
[ "Dwim", "looks", "up", "a", "reference", "by", "DWIMing", "its", "short", "name" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/reference.go#L138-L153
29,157
libgit2/git2go
reference.go
Owner
func (v *Reference) Owner() *Repository { return &Repository{ ptr: C.git_reference_owner(v.ptr), } }
go
func (v *Reference) Owner() *Repository { return &Repository{ ptr: C.git_reference_owner(v.ptr), } }
[ "func", "(", "v", "*", "Reference", ")", "Owner", "(", ")", "*", "Repository", "{", "return", "&", "Repository", "{", "ptr", ":", "C", ".", "git_reference_owner", "(", "v", ".", "ptr", ")", ",", "}", "\n", "}" ]
// Owner returns a weak reference to the repository which owns this // reference.
[ "Owner", "returns", "a", "weak", "reference", "to", "the", "repository", "which", "owns", "this", "reference", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/reference.go#L298-L302
29,158
libgit2/git2go
reference.go
Cmp
func (v *Reference) Cmp(ref2 *Reference) int { ret := int(C.git_reference_cmp(v.ptr, ref2.ptr)) runtime.KeepAlive(v) runtime.KeepAlive(ref2) return ret }
go
func (v *Reference) Cmp(ref2 *Reference) int { ret := int(C.git_reference_cmp(v.ptr, ref2.ptr)) runtime.KeepAlive(v) runtime.KeepAlive(ref2) return ret }
[ "func", "(", "v", "*", "Reference", ")", "Cmp", "(", "ref2", "*", "Reference", ")", "int", "{", "ret", ":=", "int", "(", "C", ".", "git_reference_cmp", "(", "v", ".", "ptr", ",", "ref2", ".", "ptr", ")", ")", "\n", "runtime", ".", "KeepAlive", "(...
// Cmp compares v to ref2. It returns 0 on equality, otherwise a // stable sorting.
[ "Cmp", "compares", "v", "to", "ref2", ".", "It", "returns", "0", "on", "equality", "otherwise", "a", "stable", "sorting", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/reference.go#L306-L311
29,159
libgit2/git2go
reference.go
Shorthand
func (v *Reference) Shorthand() string { ret := C.GoString(C.git_reference_shorthand(v.ptr)) runtime.KeepAlive(v) return ret }
go
func (v *Reference) Shorthand() string { ret := C.GoString(C.git_reference_shorthand(v.ptr)) runtime.KeepAlive(v) return ret }
[ "func", "(", "v", "*", "Reference", ")", "Shorthand", "(", ")", "string", "{", "ret", ":=", "C", ".", "GoString", "(", "C", ".", "git_reference_shorthand", "(", "v", ".", "ptr", ")", ")", "\n", "runtime", ".", "KeepAlive", "(", "v", ")", "\n", "ret...
// Shorthand returns a "human-readable" short reference name.
[ "Shorthand", "returns", "a", "human", "-", "readable", "short", "reference", "name", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/reference.go#L314-L318
29,160
libgit2/git2go
reference.go
Name
func (v *Reference) Name() string { ret := C.GoString(C.git_reference_name(v.ptr)) runtime.KeepAlive(v) return ret }
go
func (v *Reference) Name() string { ret := C.GoString(C.git_reference_name(v.ptr)) runtime.KeepAlive(v) return ret }
[ "func", "(", "v", "*", "Reference", ")", "Name", "(", ")", "string", "{", "ret", ":=", "C", ".", "GoString", "(", "C", ".", "git_reference_name", "(", "v", ".", "ptr", ")", ")", "\n", "runtime", ".", "KeepAlive", "(", "v", ")", "\n", "return", "r...
// Name returns the full name of v.
[ "Name", "returns", "the", "full", "name", "of", "v", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/reference.go#L321-L325
29,161
libgit2/git2go
reference.go
IsNote
func (v *Reference) IsNote() bool { ret := C.git_reference_is_note(v.ptr) == 1 runtime.KeepAlive(v) return ret }
go
func (v *Reference) IsNote() bool { ret := C.git_reference_is_note(v.ptr) == 1 runtime.KeepAlive(v) return ret }
[ "func", "(", "v", "*", "Reference", ")", "IsNote", "(", ")", "bool", "{", "ret", ":=", "C", ".", "git_reference_is_note", "(", "v", ".", "ptr", ")", "==", "1", "\n", "runtime", ".", "KeepAlive", "(", "v", ")", "\n", "return", "ret", "\n", "}" ]
// IsNote checks if the reference is a note.
[ "IsNote", "checks", "if", "the", "reference", "is", "a", "note", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/reference.go#L352-L356
29,162
libgit2/git2go
reference.go
NewReferenceIterator
func (repo *Repository) NewReferenceIterator() (*ReferenceIterator, error) { var ptr *C.git_reference_iterator runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_reference_iterator_new(&ptr, repo.ptr) if ret < 0 { return nil, MakeGitError(ret) } return newReferenceIteratorFromC(ptr, repo), n...
go
func (repo *Repository) NewReferenceIterator() (*ReferenceIterator, error) { var ptr *C.git_reference_iterator runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_reference_iterator_new(&ptr, repo.ptr) if ret < 0 { return nil, MakeGitError(ret) } return newReferenceIteratorFromC(ptr, repo), n...
[ "func", "(", "repo", "*", "Repository", ")", "NewReferenceIterator", "(", ")", "(", "*", "ReferenceIterator", ",", "error", ")", "{", "var", "ptr", "*", "C", ".", "git_reference_iterator", "\n\n", "runtime", ".", "LockOSThread", "(", ")", "\n", "defer", "r...
// NewReferenceIterator creates a new iterator over reference names
[ "NewReferenceIterator", "creates", "a", "new", "iterator", "over", "reference", "names" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/reference.go#L373-L385
29,163
libgit2/git2go
reference.go
NewReferenceNameIterator
func (repo *Repository) NewReferenceNameIterator() (*ReferenceNameIterator, error) { var ptr *C.git_reference_iterator runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_reference_iterator_new(&ptr, repo.ptr) if ret < 0 { return nil, MakeGitError(ret) } iter := newReferenceIteratorFromC(ptr,...
go
func (repo *Repository) NewReferenceNameIterator() (*ReferenceNameIterator, error) { var ptr *C.git_reference_iterator runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_reference_iterator_new(&ptr, repo.ptr) if ret < 0 { return nil, MakeGitError(ret) } iter := newReferenceIteratorFromC(ptr,...
[ "func", "(", "repo", "*", "Repository", ")", "NewReferenceNameIterator", "(", ")", "(", "*", "ReferenceNameIterator", ",", "error", ")", "{", "var", "ptr", "*", "C", ".", "git_reference_iterator", "\n\n", "runtime", ".", "LockOSThread", "(", ")", "\n", "defe...
// NewReferenceIterator creates a new branch iterator over reference names
[ "NewReferenceIterator", "creates", "a", "new", "branch", "iterator", "over", "reference", "names" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/reference.go#L388-L401
29,164
libgit2/git2go
reference.go
NewReferenceIteratorGlob
func (repo *Repository) NewReferenceIteratorGlob(glob string) (*ReferenceIterator, error) { cstr := C.CString(glob) defer C.free(unsafe.Pointer(cstr)) var ptr *C.git_reference_iterator runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_reference_iterator_glob_new(&ptr, repo.ptr, cstr) if ret < ...
go
func (repo *Repository) NewReferenceIteratorGlob(glob string) (*ReferenceIterator, error) { cstr := C.CString(glob) defer C.free(unsafe.Pointer(cstr)) var ptr *C.git_reference_iterator runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_reference_iterator_glob_new(&ptr, repo.ptr, cstr) if ret < ...
[ "func", "(", "repo", "*", "Repository", ")", "NewReferenceIteratorGlob", "(", "glob", "string", ")", "(", "*", "ReferenceIterator", ",", "error", ")", "{", "cstr", ":=", "C", ".", "CString", "(", "glob", ")", "\n", "defer", "C", ".", "free", "(", "unsa...
// NewReferenceIteratorGlob creates an iterator over reference names // that match the speicified glob. The glob is of the usual fnmatch // type.
[ "NewReferenceIteratorGlob", "creates", "an", "iterator", "over", "reference", "names", "that", "match", "the", "speicified", "glob", ".", "The", "glob", "is", "of", "the", "usual", "fnmatch", "type", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/reference.go#L406-L420
29,165
libgit2/git2go
reference.go
Next
func (v *ReferenceNameIterator) Next() (string, error) { var ptr *C.char runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_reference_next_name(&ptr, v.ptr) if ret < 0 { return "", MakeGitError(ret) } return C.GoString(ptr), nil }
go
func (v *ReferenceNameIterator) Next() (string, error) { var ptr *C.char runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_reference_next_name(&ptr, v.ptr) if ret < 0 { return "", MakeGitError(ret) } return C.GoString(ptr), nil }
[ "func", "(", "v", "*", "ReferenceNameIterator", ")", "Next", "(", ")", "(", "string", ",", "error", ")", "{", "var", "ptr", "*", "C", ".", "char", "\n\n", "runtime", ".", "LockOSThread", "(", ")", "\n", "defer", "runtime", ".", "UnlockOSThread", "(", ...
// NextName retrieves the next reference name. If the iteration is over, // the returned error is git.ErrIterOver
[ "NextName", "retrieves", "the", "next", "reference", "name", ".", "If", "the", "iteration", "is", "over", "the", "returned", "error", "is", "git", ".", "ErrIterOver" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/reference.go#L428-L440
29,166
libgit2/git2go
reference.go
Next
func (v *ReferenceIterator) Next() (*Reference, error) { var ptr *C.git_reference runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_reference_next(&ptr, v.ptr) if ret < 0 { return nil, MakeGitError(ret) } return newReferenceFromC(ptr, v.repo), nil }
go
func (v *ReferenceIterator) Next() (*Reference, error) { var ptr *C.git_reference runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_reference_next(&ptr, v.ptr) if ret < 0 { return nil, MakeGitError(ret) } return newReferenceFromC(ptr, v.repo), nil }
[ "func", "(", "v", "*", "ReferenceIterator", ")", "Next", "(", ")", "(", "*", "Reference", ",", "error", ")", "{", "var", "ptr", "*", "C", ".", "git_reference", "\n\n", "runtime", ".", "LockOSThread", "(", ")", "\n", "defer", "runtime", ".", "UnlockOSTh...
// Next retrieves the next reference. If the iterationis over, the // returned error is git.ErrIterOver
[ "Next", "retrieves", "the", "next", "reference", ".", "If", "the", "iterationis", "over", "the", "returned", "error", "is", "git", ".", "ErrIterOver" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/reference.go#L444-L456
29,167
libgit2/git2go
reference.go
Free
func (v *ReferenceIterator) Free() { runtime.SetFinalizer(v, nil) C.git_reference_iterator_free(v.ptr) }
go
func (v *ReferenceIterator) Free() { runtime.SetFinalizer(v, nil) C.git_reference_iterator_free(v.ptr) }
[ "func", "(", "v", "*", "ReferenceIterator", ")", "Free", "(", ")", "{", "runtime", ".", "SetFinalizer", "(", "v", ",", "nil", ")", "\n", "C", ".", "git_reference_iterator_free", "(", "v", ".", "ptr", ")", "\n", "}" ]
// Free the reference iterator
[ "Free", "the", "reference", "iterator" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/reference.go#L468-L471
29,168
libgit2/git2go
checkout.go
populateCheckoutOpts
func populateCheckoutOpts(ptr *C.git_checkout_options, opts *CheckoutOpts) *C.git_checkout_options { if opts == nil { return nil } C.git_checkout_init_options(ptr, 1) ptr.checkout_strategy = C.uint(opts.Strategy) ptr.disable_filters = cbool(opts.DisableFilters) ptr.dir_mode = C.uint(opts.DirMode.Perm()) ptr.f...
go
func populateCheckoutOpts(ptr *C.git_checkout_options, opts *CheckoutOpts) *C.git_checkout_options { if opts == nil { return nil } C.git_checkout_init_options(ptr, 1) ptr.checkout_strategy = C.uint(opts.Strategy) ptr.disable_filters = cbool(opts.DisableFilters) ptr.dir_mode = C.uint(opts.DirMode.Perm()) ptr.f...
[ "func", "populateCheckoutOpts", "(", "ptr", "*", "C", ".", "git_checkout_options", ",", "opts", "*", "CheckoutOpts", ")", "*", "C", ".", "git_checkout_options", "{", "if", "opts", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "C", ".", "git_checkou...
// Convert the CheckoutOpts struct to the corresponding // C-struct. Returns a pointer to ptr, or nil if opts is nil, in order // to help with what to pass.
[ "Convert", "the", "CheckoutOpts", "struct", "to", "the", "corresponding", "C", "-", "struct", ".", "Returns", "a", "pointer", "to", "ptr", "or", "nil", "if", "opts", "is", "nil", "in", "order", "to", "help", "with", "what", "to", "pass", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/checkout.go#L132-L166
29,169
libgit2/git2go
checkout.go
CheckoutHead
func (v *Repository) CheckoutHead(opts *CheckoutOpts) error { runtime.LockOSThread() defer runtime.UnlockOSThread() cOpts := opts.toC() defer freeCheckoutOpts(cOpts) ret := C.git_checkout_head(v.ptr, cOpts) runtime.KeepAlive(v) if ret < 0 { return MakeGitError(ret) } return nil }
go
func (v *Repository) CheckoutHead(opts *CheckoutOpts) error { runtime.LockOSThread() defer runtime.UnlockOSThread() cOpts := opts.toC() defer freeCheckoutOpts(cOpts) ret := C.git_checkout_head(v.ptr, cOpts) runtime.KeepAlive(v) if ret < 0 { return MakeGitError(ret) } return nil }
[ "func", "(", "v", "*", "Repository", ")", "CheckoutHead", "(", "opts", "*", "CheckoutOpts", ")", "error", "{", "runtime", ".", "LockOSThread", "(", ")", "\n", "defer", "runtime", ".", "UnlockOSThread", "(", ")", "\n\n", "cOpts", ":=", "opts", ".", "toC",...
// Updates files in the index and the working tree to match the content of // the commit pointed at by HEAD. opts may be nil.
[ "Updates", "files", "in", "the", "index", "and", "the", "working", "tree", "to", "match", "the", "content", "of", "the", "commit", "pointed", "at", "by", "HEAD", ".", "opts", "may", "be", "nil", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/checkout.go#L183-L197
29,170
libgit2/git2go
checkout.go
CheckoutIndex
func (v *Repository) CheckoutIndex(index *Index, opts *CheckoutOpts) error { var iptr *C.git_index = nil if index != nil { iptr = index.ptr } runtime.LockOSThread() defer runtime.UnlockOSThread() cOpts := opts.toC() defer freeCheckoutOpts(cOpts) ret := C.git_checkout_index(v.ptr, iptr, cOpts) runtime.Keep...
go
func (v *Repository) CheckoutIndex(index *Index, opts *CheckoutOpts) error { var iptr *C.git_index = nil if index != nil { iptr = index.ptr } runtime.LockOSThread() defer runtime.UnlockOSThread() cOpts := opts.toC() defer freeCheckoutOpts(cOpts) ret := C.git_checkout_index(v.ptr, iptr, cOpts) runtime.Keep...
[ "func", "(", "v", "*", "Repository", ")", "CheckoutIndex", "(", "index", "*", "Index", ",", "opts", "*", "CheckoutOpts", ")", "error", "{", "var", "iptr", "*", "C", ".", "git_index", "=", "nil", "\n", "if", "index", "!=", "nil", "{", "iptr", "=", "...
// Updates files in the working tree to match the content of the given // index. If index is nil, the repository's index will be used. opts // may be nil.
[ "Updates", "files", "in", "the", "working", "tree", "to", "match", "the", "content", "of", "the", "given", "index", ".", "If", "index", "is", "nil", "the", "repository", "s", "index", "will", "be", "used", ".", "opts", "may", "be", "nil", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/checkout.go#L202-L221
29,171
libgit2/git2go
packbuilder.go
ForEach
func (pb *Packbuilder) ForEach(callback PackbuilderForeachCallback) error { data := packbuilderCbData{ callback: callback, err: nil, } handle := pointerHandles.Track(&data) defer pointerHandles.Untrack(handle) runtime.LockOSThread() defer runtime.UnlockOSThread() err := C._go_git_packbuilder_foreach(p...
go
func (pb *Packbuilder) ForEach(callback PackbuilderForeachCallback) error { data := packbuilderCbData{ callback: callback, err: nil, } handle := pointerHandles.Track(&data) defer pointerHandles.Untrack(handle) runtime.LockOSThread() defer runtime.UnlockOSThread() err := C._go_git_packbuilder_foreach(p...
[ "func", "(", "pb", "*", "Packbuilder", ")", "ForEach", "(", "callback", "PackbuilderForeachCallback", ")", "error", "{", "data", ":=", "packbuilderCbData", "{", "callback", ":", "callback", ",", "err", ":", "nil", ",", "}", "\n", "handle", ":=", "pointerHand...
// ForEach repeatedly calls the callback with new packfile data until // there is no more data or the callback returns an error
[ "ForEach", "repeatedly", "calls", "the", "callback", "with", "new", "packfile", "data", "until", "there", "is", "no", "more", "data", "or", "the", "callback", "returns", "an", "error" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/packbuilder.go#L162-L183
29,172
libgit2/git2go
object.go
Owner
func (o *Object) Owner() *Repository { ret := &Repository{ ptr: C.git_object_owner(o.ptr), } runtime.KeepAlive(o) return ret }
go
func (o *Object) Owner() *Repository { ret := &Repository{ ptr: C.git_object_owner(o.ptr), } runtime.KeepAlive(o) return ret }
[ "func", "(", "o", "*", "Object", ")", "Owner", "(", ")", "*", "Repository", "{", "ret", ":=", "&", "Repository", "{", "ptr", ":", "C", ".", "git_object_owner", "(", "o", ".", "ptr", ")", ",", "}", "\n", "runtime", ".", "KeepAlive", "(", "o", ")",...
// Owner returns a weak reference to the repository which owns this // object. This won't keep the underlying repository alive.
[ "Owner", "returns", "a", "weak", "reference", "to", "the", "repository", "which", "owns", "this", "object", ".", "This", "won", "t", "keep", "the", "underlying", "repository", "alive", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/object.go#L82-L88
29,173
libgit2/git2go
odb.go
NewReadStream
func (v *Odb) NewReadStream(id *Oid) (*OdbReadStream, error) { stream := new(OdbReadStream) var ctype C.git_object_t var csize C.size_t runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_odb_open_rstream(&stream.ptr, &csize, &ctype, v.ptr, id.toC()) runtime.KeepAlive(v) runtime.KeepAlive(id) ...
go
func (v *Odb) NewReadStream(id *Oid) (*OdbReadStream, error) { stream := new(OdbReadStream) var ctype C.git_object_t var csize C.size_t runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_odb_open_rstream(&stream.ptr, &csize, &ctype, v.ptr, id.toC()) runtime.KeepAlive(v) runtime.KeepAlive(id) ...
[ "func", "(", "v", "*", "Odb", ")", "NewReadStream", "(", "id", "*", "Oid", ")", "(", "*", "OdbReadStream", ",", "error", ")", "{", "stream", ":=", "new", "(", "OdbReadStream", ")", "\n", "var", "ctype", "C", ".", "git_object_t", "\n", "var", "csize",...
// NewReadStream opens a read stream from the ODB. Reading from it will give you the // contents of the object.
[ "NewReadStream", "opens", "a", "read", "stream", "from", "the", "ODB", ".", "Reading", "from", "it", "will", "give", "you", "the", "contents", "of", "the", "object", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/odb.go#L194-L213
29,174
libgit2/git2go
odb.go
NewWriteStream
func (v *Odb) NewWriteStream(size int64, otype ObjectType) (*OdbWriteStream, error) { stream := new(OdbWriteStream) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_odb_open_wstream(&stream.ptr, v.ptr, C.git_off_t(size), C.git_object_t(otype)) runtime.KeepAlive(v) if ret < 0 { return nil, Ma...
go
func (v *Odb) NewWriteStream(size int64, otype ObjectType) (*OdbWriteStream, error) { stream := new(OdbWriteStream) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_odb_open_wstream(&stream.ptr, v.ptr, C.git_off_t(size), C.git_object_t(otype)) runtime.KeepAlive(v) if ret < 0 { return nil, Ma...
[ "func", "(", "v", "*", "Odb", ")", "NewWriteStream", "(", "size", "int64", ",", "otype", "ObjectType", ")", "(", "*", "OdbWriteStream", ",", "error", ")", "{", "stream", ":=", "new", "(", "OdbWriteStream", ")", "\n\n", "runtime", ".", "LockOSThread", "("...
// NewWriteStream opens a write stream to the ODB, which allows you to // create a new object in the database. The size and type must be // known in advance
[ "NewWriteStream", "opens", "a", "write", "stream", "to", "the", "ODB", "which", "allows", "you", "to", "create", "a", "new", "object", "in", "the", "database", ".", "The", "size", "and", "type", "must", "be", "known", "in", "advance" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/odb.go#L218-L232
29,175
libgit2/git2go
odb.go
Data
func (object *OdbObject) Data() (data []byte) { var c_blob unsafe.Pointer = C.git_odb_object_data(object.ptr) var blob []byte len := int(C.git_odb_object_size(object.ptr)) sliceHeader := (*reflect.SliceHeader)((unsafe.Pointer(&blob))) sliceHeader.Cap = len sliceHeader.Len = len sliceHeader.Data = uintptr(c_blo...
go
func (object *OdbObject) Data() (data []byte) { var c_blob unsafe.Pointer = C.git_odb_object_data(object.ptr) var blob []byte len := int(C.git_odb_object_size(object.ptr)) sliceHeader := (*reflect.SliceHeader)((unsafe.Pointer(&blob))) sliceHeader.Cap = len sliceHeader.Len = len sliceHeader.Data = uintptr(c_blo...
[ "func", "(", "object", "*", "OdbObject", ")", "Data", "(", ")", "(", "data", "[", "]", "byte", ")", "{", "var", "c_blob", "unsafe", ".", "Pointer", "=", "C", ".", "git_odb_object_data", "(", "object", ".", "ptr", ")", "\n", "var", "blob", "[", "]",...
// Data returns a slice pointing to the unmanaged object memory. You must make // sure the object is referenced for at least as long as the slice is used.
[ "Data", "returns", "a", "slice", "pointing", "to", "the", "unmanaged", "object", "memory", ".", "You", "must", "make", "sure", "the", "object", "is", "referenced", "for", "at", "least", "as", "long", "as", "the", "slice", "is", "used", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/odb.go#L267-L279
29,176
libgit2/git2go
odb.go
Read
func (stream *OdbReadStream) Read(data []byte) (int, error) { header := (*reflect.SliceHeader)(unsafe.Pointer(&data)) ptr := (*C.char)(unsafe.Pointer(header.Data)) size := C.size_t(header.Cap) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_odb_stream_read(stream.ptr, ptr, size) runtime.Keep...
go
func (stream *OdbReadStream) Read(data []byte) (int, error) { header := (*reflect.SliceHeader)(unsafe.Pointer(&data)) ptr := (*C.char)(unsafe.Pointer(header.Data)) size := C.size_t(header.Cap) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_odb_stream_read(stream.ptr, ptr, size) runtime.Keep...
[ "func", "(", "stream", "*", "OdbReadStream", ")", "Read", "(", "data", "[", "]", "byte", ")", "(", "int", ",", "error", ")", "{", "header", ":=", "(", "*", "reflect", ".", "SliceHeader", ")", "(", "unsafe", ".", "Pointer", "(", "&", "data", ")", ...
// Read reads from the stream
[ "Read", "reads", "from", "the", "stream" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/odb.go#L288-L308
29,177
libgit2/git2go
odb.go
Write
func (stream *OdbWriteStream) Write(data []byte) (int, error) { header := (*reflect.SliceHeader)(unsafe.Pointer(&data)) ptr := (*C.char)(unsafe.Pointer(header.Data)) size := C.size_t(header.Len) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_odb_stream_write(stream.ptr, ptr, size) runtime.K...
go
func (stream *OdbWriteStream) Write(data []byte) (int, error) { header := (*reflect.SliceHeader)(unsafe.Pointer(&data)) ptr := (*C.char)(unsafe.Pointer(header.Data)) size := C.size_t(header.Len) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_odb_stream_write(stream.ptr, ptr, size) runtime.K...
[ "func", "(", "stream", "*", "OdbWriteStream", ")", "Write", "(", "data", "[", "]", "byte", ")", "(", "int", ",", "error", ")", "{", "header", ":=", "(", "*", "reflect", ".", "SliceHeader", ")", "(", "unsafe", ".", "Pointer", "(", "&", "data", ")", ...
// Write writes to the stream
[ "Write", "writes", "to", "the", "stream" ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/odb.go#L327-L342
29,178
libgit2/git2go
odb.go
Close
func (stream *OdbWriteStream) Close() error { runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_odb_stream_finalize_write(stream.Id.toC(), stream.ptr) runtime.KeepAlive(stream) if ret < 0 { return MakeGitError(ret) } return nil }
go
func (stream *OdbWriteStream) Close() error { runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_odb_stream_finalize_write(stream.Id.toC(), stream.ptr) runtime.KeepAlive(stream) if ret < 0 { return MakeGitError(ret) } return nil }
[ "func", "(", "stream", "*", "OdbWriteStream", ")", "Close", "(", ")", "error", "{", "runtime", ".", "LockOSThread", "(", ")", "\n", "defer", "runtime", ".", "UnlockOSThread", "(", ")", "\n\n", "ret", ":=", "C", ".", "git_odb_stream_finalize_write", "(", "s...
// Close signals that all the data has been written and stores the // resulting object id in the stream's Id field.
[ "Close", "signals", "that", "all", "the", "data", "has", "been", "written", "and", "stores", "the", "resulting", "object", "id", "in", "the", "stream", "s", "Id", "field", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/odb.go#L346-L357
29,179
libgit2/git2go
credentials.go
NewCredSshKey
func NewCredSshKey(username string, publicKeyPath string, privateKeyPath string, passphrase string) (int, Cred) { cred := Cred{} cusername := C.CString(username) defer C.free(unsafe.Pointer(cusername)) cpublickey := C.CString(publicKeyPath) defer C.free(unsafe.Pointer(cpublickey)) cprivatekey := C.CString(private...
go
func NewCredSshKey(username string, publicKeyPath string, privateKeyPath string, passphrase string) (int, Cred) { cred := Cred{} cusername := C.CString(username) defer C.free(unsafe.Pointer(cusername)) cpublickey := C.CString(publicKeyPath) defer C.free(unsafe.Pointer(cpublickey)) cprivatekey := C.CString(private...
[ "func", "NewCredSshKey", "(", "username", "string", ",", "publicKeyPath", "string", ",", "privateKeyPath", "string", ",", "passphrase", "string", ")", "(", "int", ",", "Cred", ")", "{", "cred", ":=", "Cred", "{", "}", "\n", "cusername", ":=", "C", ".", "...
// NewCredSshKey creates new ssh credentials reading the public and private keys // from the file system.
[ "NewCredSshKey", "creates", "new", "ssh", "credentials", "reading", "the", "public", "and", "private", "keys", "from", "the", "file", "system", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/credentials.go#L49-L61
29,180
libgit2/git2go
credentials.go
NewCredSshKeyFromMemory
func NewCredSshKeyFromMemory(username string, publicKey string, privateKey string, passphrase string) (int, Cred) { cred := Cred{} cusername := C.CString(username) defer C.free(unsafe.Pointer(cusername)) cpublickey := C.CString(publicKey) defer C.free(unsafe.Pointer(cpublickey)) cprivatekey := C.CString(privateKe...
go
func NewCredSshKeyFromMemory(username string, publicKey string, privateKey string, passphrase string) (int, Cred) { cred := Cred{} cusername := C.CString(username) defer C.free(unsafe.Pointer(cusername)) cpublickey := C.CString(publicKey) defer C.free(unsafe.Pointer(cpublickey)) cprivatekey := C.CString(privateKe...
[ "func", "NewCredSshKeyFromMemory", "(", "username", "string", ",", "publicKey", "string", ",", "privateKey", "string", ",", "passphrase", "string", ")", "(", "int", ",", "Cred", ")", "{", "cred", ":=", "Cred", "{", "}", "\n", "cusername", ":=", "C", ".", ...
// NewCredSshKeyFromMemory creates new ssh credentials using the publicKey and privateKey // arguments as the values for the public and private keys.
[ "NewCredSshKeyFromMemory", "creates", "new", "ssh", "credentials", "using", "the", "publicKey", "and", "privateKey", "arguments", "as", "the", "values", "for", "the", "public", "and", "private", "keys", "." ]
bf1e8a4338822ad2539a3876f58b15b590eb9e1f
https://github.com/libgit2/git2go/blob/bf1e8a4338822ad2539a3876f58b15b590eb9e1f/credentials.go#L65-L77
29,181
uber-go/fx
shutdown.go
Shutdown
func (s *shutdowner) Shutdown(opts ...ShutdownOption) error { return s.app.broadcastSignal(syscall.SIGTERM) }
go
func (s *shutdowner) Shutdown(opts ...ShutdownOption) error { return s.app.broadcastSignal(syscall.SIGTERM) }
[ "func", "(", "s", "*", "shutdowner", ")", "Shutdown", "(", "opts", "...", "ShutdownOption", ")", "error", "{", "return", "s", ".", "app", ".", "broadcastSignal", "(", "syscall", ".", "SIGTERM", ")", "\n", "}" ]
// Shutdown broadcasts a signal to all of the application's Done channels // and begins the Stop process.
[ "Shutdown", "broadcasts", "a", "signal", "to", "all", "of", "the", "application", "s", "Done", "channels", "and", "begins", "the", "Stop", "process", "." ]
544d97a6e020226621cefffcbc38a9e2d320584c
https://github.com/uber-go/fx/blob/544d97a6e020226621cefffcbc38a9e2d320584c/shutdown.go#L49-L51
29,182
uber-go/fx
internal/lifecycle/lifecycle.go
New
func New(logger *fxlog.Logger) *Lifecycle { if logger == nil { logger = fxlog.New() } return &Lifecycle{logger: logger} }
go
func New(logger *fxlog.Logger) *Lifecycle { if logger == nil { logger = fxlog.New() } return &Lifecycle{logger: logger} }
[ "func", "New", "(", "logger", "*", "fxlog", ".", "Logger", ")", "*", "Lifecycle", "{", "if", "logger", "==", "nil", "{", "logger", "=", "fxlog", ".", "New", "(", ")", "\n", "}", "\n", "return", "&", "Lifecycle", "{", "logger", ":", "logger", "}", ...
// New constructs a new Lifecycle.
[ "New", "constructs", "a", "new", "Lifecycle", "." ]
544d97a6e020226621cefffcbc38a9e2d320584c
https://github.com/uber-go/fx/blob/544d97a6e020226621cefffcbc38a9e2d320584c/internal/lifecycle/lifecycle.go#L47-L52
29,183
uber-go/fx
internal/lifecycle/lifecycle.go
Append
func (l *Lifecycle) Append(hook Hook) { hook.caller = fxreflect.Caller() l.hooks = append(l.hooks, hook) }
go
func (l *Lifecycle) Append(hook Hook) { hook.caller = fxreflect.Caller() l.hooks = append(l.hooks, hook) }
[ "func", "(", "l", "*", "Lifecycle", ")", "Append", "(", "hook", "Hook", ")", "{", "hook", ".", "caller", "=", "fxreflect", ".", "Caller", "(", ")", "\n", "l", ".", "hooks", "=", "append", "(", "l", ".", "hooks", ",", "hook", ")", "\n", "}" ]
// Append adds a Hook to the lifecycle.
[ "Append", "adds", "a", "Hook", "to", "the", "lifecycle", "." ]
544d97a6e020226621cefffcbc38a9e2d320584c
https://github.com/uber-go/fx/blob/544d97a6e020226621cefffcbc38a9e2d320584c/internal/lifecycle/lifecycle.go#L55-L58
29,184
uber-go/fx
internal/lifecycle/lifecycle.go
Start
func (l *Lifecycle) Start(ctx context.Context) error { for _, hook := range l.hooks { if hook.OnStart != nil { l.logger.Printf("START\t\t%s()", hook.caller) if err := hook.OnStart(ctx); err != nil { return err } } l.numStarted++ } return nil }
go
func (l *Lifecycle) Start(ctx context.Context) error { for _, hook := range l.hooks { if hook.OnStart != nil { l.logger.Printf("START\t\t%s()", hook.caller) if err := hook.OnStart(ctx); err != nil { return err } } l.numStarted++ } return nil }
[ "func", "(", "l", "*", "Lifecycle", ")", "Start", "(", "ctx", "context", ".", "Context", ")", "error", "{", "for", "_", ",", "hook", ":=", "range", "l", ".", "hooks", "{", "if", "hook", ".", "OnStart", "!=", "nil", "{", "l", ".", "logger", ".", ...
// Start runs all OnStart hooks, returning immediately if it encounters an // error.
[ "Start", "runs", "all", "OnStart", "hooks", "returning", "immediately", "if", "it", "encounters", "an", "error", "." ]
544d97a6e020226621cefffcbc38a9e2d320584c
https://github.com/uber-go/fx/blob/544d97a6e020226621cefffcbc38a9e2d320584c/internal/lifecycle/lifecycle.go#L62-L73
29,185
uber-go/fx
internal/lifecycle/lifecycle.go
Stop
func (l *Lifecycle) Stop(ctx context.Context) error { var errs []error // Run backward from last successful OnStart. for ; l.numStarted > 0; l.numStarted-- { hook := l.hooks[l.numStarted-1] if hook.OnStop == nil { continue } l.logger.Printf("STOP\t\t%s()", hook.caller) if err := hook.OnStop(ctx); err !=...
go
func (l *Lifecycle) Stop(ctx context.Context) error { var errs []error // Run backward from last successful OnStart. for ; l.numStarted > 0; l.numStarted-- { hook := l.hooks[l.numStarted-1] if hook.OnStop == nil { continue } l.logger.Printf("STOP\t\t%s()", hook.caller) if err := hook.OnStop(ctx); err !=...
[ "func", "(", "l", "*", "Lifecycle", ")", "Stop", "(", "ctx", "context", ".", "Context", ")", "error", "{", "var", "errs", "[", "]", "error", "\n", "// Run backward from last successful OnStart.", "for", ";", "l", ".", "numStarted", ">", "0", ";", "l", "....
// Stop runs any OnStop hooks whose OnStart counterpart succeeded. OnStop // hooks run in reverse order.
[ "Stop", "runs", "any", "OnStop", "hooks", "whose", "OnStart", "counterpart", "succeeded", ".", "OnStop", "hooks", "run", "in", "reverse", "order", "." ]
544d97a6e020226621cefffcbc38a9e2d320584c
https://github.com/uber-go/fx/blob/544d97a6e020226621cefffcbc38a9e2d320584c/internal/lifecycle/lifecycle.go#L77-L92
29,186
uber-go/fx
internal/fxlog/fxlog.go
PrintProvide
func (l *Logger) PrintProvide(t interface{}) { for _, rtype := range fxreflect.ReturnTypes(t) { l.Printf("PROVIDE\t%s <= %s", rtype, fxreflect.FuncName(t)) } }
go
func (l *Logger) PrintProvide(t interface{}) { for _, rtype := range fxreflect.ReturnTypes(t) { l.Printf("PROVIDE\t%s <= %s", rtype, fxreflect.FuncName(t)) } }
[ "func", "(", "l", "*", "Logger", ")", "PrintProvide", "(", "t", "interface", "{", "}", ")", "{", "for", "_", ",", "rtype", ":=", "range", "fxreflect", ".", "ReturnTypes", "(", "t", ")", "{", "l", ".", "Printf", "(", "\"", "\\t", "\"", ",", "rtype...
// PrintProvide logs a type provided into the dig.Container.
[ "PrintProvide", "logs", "a", "type", "provided", "into", "the", "dig", ".", "Container", "." ]
544d97a6e020226621cefffcbc38a9e2d320584c
https://github.com/uber-go/fx/blob/544d97a6e020226621cefffcbc38a9e2d320584c/internal/fxlog/fxlog.go#L55-L59
29,187
uber-go/fx
internal/fxlog/fxlog.go
PrintSignal
func (l *Logger) PrintSignal(signal os.Signal) { l.Printf(strings.ToUpper(signal.String())) }
go
func (l *Logger) PrintSignal(signal os.Signal) { l.Printf(strings.ToUpper(signal.String())) }
[ "func", "(", "l", "*", "Logger", ")", "PrintSignal", "(", "signal", "os", ".", "Signal", ")", "{", "l", ".", "Printf", "(", "strings", ".", "ToUpper", "(", "signal", ".", "String", "(", ")", ")", ")", "\n", "}" ]
// PrintSignal logs an os.Signal.
[ "PrintSignal", "logs", "an", "os", ".", "Signal", "." ]
544d97a6e020226621cefffcbc38a9e2d320584c
https://github.com/uber-go/fx/blob/544d97a6e020226621cefffcbc38a9e2d320584c/internal/fxlog/fxlog.go#L62-L64
29,188
uber-go/fx
internal/fxlog/fxlog.go
Panic
func (l *Logger) Panic(err error) { l.Printer.Printf(prepend(err.Error())) panic(err) }
go
func (l *Logger) Panic(err error) { l.Printer.Printf(prepend(err.Error())) panic(err) }
[ "func", "(", "l", "*", "Logger", ")", "Panic", "(", "err", "error", ")", "{", "l", ".", "Printer", ".", "Printf", "(", "prepend", "(", "err", ".", "Error", "(", ")", ")", ")", "\n", "panic", "(", "err", ")", "\n", "}" ]
// Panic logs an Fx line then panics.
[ "Panic", "logs", "an", "Fx", "line", "then", "panics", "." ]
544d97a6e020226621cefffcbc38a9e2d320584c
https://github.com/uber-go/fx/blob/544d97a6e020226621cefffcbc38a9e2d320584c/internal/fxlog/fxlog.go#L67-L70
29,189
uber-go/fx
internal/fxlog/fxlog.go
Fatalf
func (l *Logger) Fatalf(format string, v ...interface{}) { l.Printer.Printf(prepend(format), v...) _exit() }
go
func (l *Logger) Fatalf(format string, v ...interface{}) { l.Printer.Printf(prepend(format), v...) _exit() }
[ "func", "(", "l", "*", "Logger", ")", "Fatalf", "(", "format", "string", ",", "v", "...", "interface", "{", "}", ")", "{", "l", ".", "Printer", ".", "Printf", "(", "prepend", "(", "format", ")", ",", "v", "...", ")", "\n", "_exit", "(", ")", "\...
// Fatalf logs an Fx line then fatals.
[ "Fatalf", "logs", "an", "Fx", "line", "then", "fatals", "." ]
544d97a6e020226621cefffcbc38a9e2d320584c
https://github.com/uber-go/fx/blob/544d97a6e020226621cefffcbc38a9e2d320584c/internal/fxlog/fxlog.go#L73-L76
29,190
uber-go/fx
internal/fxreflect/fxreflect.go
ReturnTypes
func ReturnTypes(t interface{}) []string { if reflect.TypeOf(t).Kind() != reflect.Func { // Invalid provide, will be logged as an error. return []string{} } rtypes := []string{} ft := reflect.ValueOf(t).Type() for i := 0; i < ft.NumOut(); i++ { t := ft.Out(i) traverseOuts(key{t: t}, func(s string) { ...
go
func ReturnTypes(t interface{}) []string { if reflect.TypeOf(t).Kind() != reflect.Func { // Invalid provide, will be logged as an error. return []string{} } rtypes := []string{} ft := reflect.ValueOf(t).Type() for i := 0; i < ft.NumOut(); i++ { t := ft.Out(i) traverseOuts(key{t: t}, func(s string) { ...
[ "func", "ReturnTypes", "(", "t", "interface", "{", "}", ")", "[", "]", "string", "{", "if", "reflect", ".", "TypeOf", "(", "t", ")", ".", "Kind", "(", ")", "!=", "reflect", ".", "Func", "{", "// Invalid provide, will be logged as an error.", "return", "[",...
// ReturnTypes takes a func and returns a slice of string'd types.
[ "ReturnTypes", "takes", "a", "func", "and", "returns", "a", "slice", "of", "string", "d", "types", "." ]
544d97a6e020226621cefffcbc38a9e2d320584c
https://github.com/uber-go/fx/blob/544d97a6e020226621cefffcbc38a9e2d320584c/internal/fxreflect/fxreflect.go#L38-L56
29,191
uber-go/fx
internal/fxreflect/fxreflect.go
sanitize
func sanitize(function string) string { // Use the stdlib to un-escape any package import paths which can happen // in the case of the "dot-git" postfix. Seems like a bug in stdlib =/ if unescaped, err := url.QueryUnescape(function); err == nil { function = unescaped } // strip everything prior to the vendor r...
go
func sanitize(function string) string { // Use the stdlib to un-escape any package import paths which can happen // in the case of the "dot-git" postfix. Seems like a bug in stdlib =/ if unescaped, err := url.QueryUnescape(function); err == nil { function = unescaped } // strip everything prior to the vendor r...
[ "func", "sanitize", "(", "function", "string", ")", "string", "{", "// Use the stdlib to un-escape any package import paths which can happen", "// in the case of the \"dot-git\" postfix. Seems like a bug in stdlib =/", "if", "unescaped", ",", "err", ":=", "url", ".", "QueryUnescape...
// sanitize makes the function name suitable for logging display. It removes // url-encoded elements from the `dot.git` package names and shortens the // vendored paths.
[ "sanitize", "makes", "the", "function", "name", "suitable", "for", "logging", "display", ".", "It", "removes", "url", "-", "encoded", "elements", "from", "the", "dot", ".", "git", "package", "names", "and", "shortens", "the", "vendored", "paths", "." ]
544d97a6e020226621cefffcbc38a9e2d320584c
https://github.com/uber-go/fx/blob/544d97a6e020226621cefffcbc38a9e2d320584c/internal/fxreflect/fxreflect.go#L104-L113
29,192
uber-go/fx
internal/fxreflect/fxreflect.go
Caller
func Caller() string { // Ascend at most 8 frames looking for a caller outside fx. pcs := make([]uintptr, 8) // Don't include this frame. n := runtime.Callers(2, pcs) if n == 0 { return "n/a" } frames := runtime.CallersFrames(pcs) for f, more := frames.Next(); more; f, more = frames.Next() { if shouldIgno...
go
func Caller() string { // Ascend at most 8 frames looking for a caller outside fx. pcs := make([]uintptr, 8) // Don't include this frame. n := runtime.Callers(2, pcs) if n == 0 { return "n/a" } frames := runtime.CallersFrames(pcs) for f, more := frames.Next(); more; f, more = frames.Next() { if shouldIgno...
[ "func", "Caller", "(", ")", "string", "{", "// Ascend at most 8 frames looking for a caller outside fx.", "pcs", ":=", "make", "(", "[", "]", "uintptr", ",", "8", ")", "\n\n", "// Don't include this frame.", "n", ":=", "runtime", ".", "Callers", "(", "2", ",", "...
// Caller returns the formatted calling func name
[ "Caller", "returns", "the", "formatted", "calling", "func", "name" ]
544d97a6e020226621cefffcbc38a9e2d320584c
https://github.com/uber-go/fx/blob/544d97a6e020226621cefffcbc38a9e2d320584c/internal/fxreflect/fxreflect.go#L116-L134
29,193
uber-go/fx
internal/fxreflect/fxreflect.go
FuncName
func FuncName(fn interface{}) string { fnV := reflect.ValueOf(fn) if fnV.Kind() != reflect.Func { return "n/a" } function := runtime.FuncForPC(fnV.Pointer()).Name() return fmt.Sprintf("%s()", sanitize(function)) }
go
func FuncName(fn interface{}) string { fnV := reflect.ValueOf(fn) if fnV.Kind() != reflect.Func { return "n/a" } function := runtime.FuncForPC(fnV.Pointer()).Name() return fmt.Sprintf("%s()", sanitize(function)) }
[ "func", "FuncName", "(", "fn", "interface", "{", "}", ")", "string", "{", "fnV", ":=", "reflect", ".", "ValueOf", "(", "fn", ")", "\n", "if", "fnV", ".", "Kind", "(", ")", "!=", "reflect", ".", "Func", "{", "return", "\"", "\"", "\n", "}", "\n\n"...
// FuncName returns a funcs formatted name
[ "FuncName", "returns", "a", "funcs", "formatted", "name" ]
544d97a6e020226621cefffcbc38a9e2d320584c
https://github.com/uber-go/fx/blob/544d97a6e020226621cefffcbc38a9e2d320584c/internal/fxreflect/fxreflect.go#L137-L145
29,194
uber-go/fx
internal/fxreflect/fxreflect.go
shouldIgnoreFrame
func shouldIgnoreFrame(f runtime.Frame) bool { if strings.Contains(f.File, "_test.go") { return false } if strings.Contains(f.File, "go.uber.org/fx") { return true } return false }
go
func shouldIgnoreFrame(f runtime.Frame) bool { if strings.Contains(f.File, "_test.go") { return false } if strings.Contains(f.File, "go.uber.org/fx") { return true } return false }
[ "func", "shouldIgnoreFrame", "(", "f", "runtime", ".", "Frame", ")", "bool", "{", "if", "strings", ".", "Contains", "(", "f", ".", "File", ",", "\"", "\"", ")", "{", "return", "false", "\n", "}", "\n", "if", "strings", ".", "Contains", "(", "f", "....
// Ascend the call stack until we leave the Fx production code. This allows us // to avoid hard-coding a frame skip, which makes this code work well even // when it's wrapped.
[ "Ascend", "the", "call", "stack", "until", "we", "leave", "the", "Fx", "production", "code", ".", "This", "allows", "us", "to", "avoid", "hard", "-", "coding", "a", "frame", "skip", "which", "makes", "this", "code", "work", "well", "even", "when", "it", ...
544d97a6e020226621cefffcbc38a9e2d320584c
https://github.com/uber-go/fx/blob/544d97a6e020226621cefffcbc38a9e2d320584c/internal/fxreflect/fxreflect.go#L155-L163
29,195
uber-go/fx
app.go
Error
func Error(errs ...error) Option { return optionFunc(func(app *App) { app.err = multierr.Append(app.err, multierr.Combine(errs...)) }) }
go
func Error(errs ...error) Option { return optionFunc(func(app *App) { app.err = multierr.Append(app.err, multierr.Combine(errs...)) }) }
[ "func", "Error", "(", "errs", "...", "error", ")", "Option", "{", "return", "optionFunc", "(", "func", "(", "app", "*", "App", ")", "{", "app", ".", "err", "=", "multierr", ".", "Append", "(", "app", ".", "err", ",", "multierr", ".", "Combine", "("...
// Error registers any number of errors with the application to short-circuit // startup. If more than one error is given, the errors are combined into a // single error. // // Similar to invocations, errors are applied in order. All Provide and Invoke // options registered before or after an Error option will not be a...
[ "Error", "registers", "any", "number", "of", "errors", "with", "the", "application", "to", "short", "-", "circuit", "startup", ".", "If", "more", "than", "one", "error", "is", "given", "the", "errors", "are", "combined", "into", "a", "single", "error", "."...
544d97a6e020226621cefffcbc38a9e2d320584c
https://github.com/uber-go/fx/blob/544d97a6e020226621cefffcbc38a9e2d320584c/app.go#L149-L153
29,196
uber-go/fx
app.go
StartTimeout
func StartTimeout(v time.Duration) Option { return optionFunc(func(app *App) { app.startTimeout = v }) }
go
func StartTimeout(v time.Duration) Option { return optionFunc(func(app *App) { app.startTimeout = v }) }
[ "func", "StartTimeout", "(", "v", "time", ".", "Duration", ")", "Option", "{", "return", "optionFunc", "(", "func", "(", "app", "*", "App", ")", "{", "app", ".", "startTimeout", "=", "v", "\n", "}", ")", "\n", "}" ]
// StartTimeout changes the application's start timeout.
[ "StartTimeout", "changes", "the", "application", "s", "start", "timeout", "." ]
544d97a6e020226621cefffcbc38a9e2d320584c
https://github.com/uber-go/fx/blob/544d97a6e020226621cefffcbc38a9e2d320584c/app.go#L207-L211
29,197
uber-go/fx
app.go
StopTimeout
func StopTimeout(v time.Duration) Option { return optionFunc(func(app *App) { app.stopTimeout = v }) }
go
func StopTimeout(v time.Duration) Option { return optionFunc(func(app *App) { app.stopTimeout = v }) }
[ "func", "StopTimeout", "(", "v", "time", ".", "Duration", ")", "Option", "{", "return", "optionFunc", "(", "func", "(", "app", "*", "App", ")", "{", "app", ".", "stopTimeout", "=", "v", "\n", "}", ")", "\n", "}" ]
// StopTimeout changes the application's stop timeout.
[ "StopTimeout", "changes", "the", "application", "s", "stop", "timeout", "." ]
544d97a6e020226621cefffcbc38a9e2d320584c
https://github.com/uber-go/fx/blob/544d97a6e020226621cefffcbc38a9e2d320584c/app.go#L214-L218
29,198
uber-go/fx
app.go
Logger
func Logger(p Printer) Option { return optionFunc(func(app *App) { app.logger = &fxlog.Logger{Printer: p} app.lifecycle = &lifecycleWrapper{lifecycle.New(app.logger)} }) }
go
func Logger(p Printer) Option { return optionFunc(func(app *App) { app.logger = &fxlog.Logger{Printer: p} app.lifecycle = &lifecycleWrapper{lifecycle.New(app.logger)} }) }
[ "func", "Logger", "(", "p", "Printer", ")", "Option", "{", "return", "optionFunc", "(", "func", "(", "app", "*", "App", ")", "{", "app", ".", "logger", "=", "&", "fxlog", ".", "Logger", "{", "Printer", ":", "p", "}", "\n", "app", ".", "lifecycle", ...
// Logger redirects the application's log output to the provided printer.
[ "Logger", "redirects", "the", "application", "s", "log", "output", "to", "the", "provided", "printer", "." ]
544d97a6e020226621cefffcbc38a9e2d320584c
https://github.com/uber-go/fx/blob/544d97a6e020226621cefffcbc38a9e2d320584c/app.go#L227-L232
29,199
uber-go/fx
app.go
New
func New(opts ...Option) *App { logger := fxlog.New() lc := &lifecycleWrapper{lifecycle.New(logger)} app := &App{ container: dig.New(dig.DeferAcyclicVerification()), lifecycle: lc, logger: logger, startTimeout: DefaultTimeout, stopTimeout: DefaultTimeout, } for _, opt := range opts { opt...
go
func New(opts ...Option) *App { logger := fxlog.New() lc := &lifecycleWrapper{lifecycle.New(logger)} app := &App{ container: dig.New(dig.DeferAcyclicVerification()), lifecycle: lc, logger: logger, startTimeout: DefaultTimeout, stopTimeout: DefaultTimeout, } for _, opt := range opts { opt...
[ "func", "New", "(", "opts", "...", "Option", ")", "*", "App", "{", "logger", ":=", "fxlog", ".", "New", "(", ")", "\n", "lc", ":=", "&", "lifecycleWrapper", "{", "lifecycle", ".", "New", "(", "logger", ")", "}", "\n\n", "app", ":=", "&", "App", "...
// New creates and initializes an App, immediately executing any functions // registered via Invoke options. See the documentation of the App struct for // details on the application's initialization, startup, and shutdown logic.
[ "New", "creates", "and", "initializes", "an", "App", "immediately", "executing", "any", "functions", "registered", "via", "Invoke", "options", ".", "See", "the", "documentation", "of", "the", "App", "struct", "for", "details", "on", "the", "application", "s", ...
544d97a6e020226621cefffcbc38a9e2d320584c
https://github.com/uber-go/fx/blob/544d97a6e020226621cefffcbc38a9e2d320584c/app.go#L322-L364