Skip to content
Snippets Groups Projects
Commit d125b96c authored by Nick Thomas's avatar Nick Thomas
Browse files

Pass commit dates to elastisearch

parent 69a85e50
No related branches found
No related tags found
1 merge request!1Initial implementation of an elasticsearch indexer in Go
package indexer
 
import (
"time"
"srcd.works/go-git.v4/plumbing/object"
)
 
const (
elasticTimeFormat = "20060102150405-0700"
)
type Person struct {
Name string `json:"name"`
Email string `json:"email"`
Time string `json:"time"` // %Y%m%dT%H%M%S%z
}
 
func GenerateDate(t time.Time) string {
return t.Format(elasticTimeFormat)
}
func BuildPerson(p object.Signature) *Person {
return &Person{
Name: p.Name,
Email: p.Email,
//Time: // FIXME: work this out
Time: GenerateDate(p.When),
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment