Documentation
¶
Index ¶
- Variables
- func DetectBinary(data []byte) bool
- func DetectLanguage(filename string, data []byte) string
- func GenerateBlobID(parentID, filename string) string
- func GenerateCommitID(parentID, commitSHA string) string
- func GenerateDate(t time.Time) string
- type Blob
- type Commit
- type Indexer
- type Person
- type Submitter
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SkipTooLargeBlob = fmt.Errorf("Blob should be skipped: Too large") SkipBinaryBlob = fmt.Errorf("Blob should be skipped: binary") )
Functions ¶
func DetectBinary ¶
DetectBinary checks whether the passed-in data contains a NUL byte. Only scan the start of large blobs. This is the same test performed by git to check text/binary
func DetectLanguage ¶
DetectLanguage returns a string describing the language of the file. This is programming language, rather than natural language.
If no language is detected, "Text" is returned.
func GenerateBlobID ¶
func GenerateCommitID ¶
func GenerateDate ¶
Types ¶
type Blob ¶
type Blob struct { Type string `json:"type"` ID string `json:"-"` OID string `json:"oid"` RepoID string `json:"rid"` CommitSHA string `json:"commit_sha"` Content string `json:"content"` Path string `json:"path"` // Message copied from gitlab-elasticsearch-git: // // We're duplicating file_name parameter here because we need another // analyzer for it. // //Ideally this should be done with copy_to: 'blob.file_name' option //but it does not work in ES v2.3.*. We're doing it so to not make users //install newest versions // //https://github.com/elastic/elasticsearch-mapper-attachments/issues/124 Filename string `json:"file_name"` Language string `json:"language"` }
type Commit ¶
type Indexer ¶
type Indexer struct { git.Repository Submitter }
func (*Indexer) IndexBlobs ¶
func (*Indexer) IndexCommits ¶
Click to show internal directories.
Click to hide internal directories.