Versions in this module Expand all Collapse all v0 v0.7.0 May 13, 2019 Changes in this version + const Abuse + const All + const DefaultDataDir + const Devstats + const DevstatsCode + const EngineIsClosedError + const GHA + const GHAAdmin + const HideCfgFile + const InvalidCatalogName + const Kubernetes + const LocalGitScripts + const Localhost + const Merged + const Metrics + const Nil + const NotFound + const Now + const Null + const Password + const Quarter + const Retry + const TimeCol + const TimeoutError + const Today + const Unset + func ActorHit(ctx *Ctx, actorName string) bool + func ActorIDOrNil(actPtr *Actor) interface + func ActorLoginOrNil(actPtr *Actor, maybeHide func(string) string) interface + func AddNIntervals(dt time.Time, n int, ...) time.Time + func AddTSPoint(ctx *Ctx, pts *TSPoints, pt TSPoint) + func ArtificialEvent(c *sql.DB, ctx *Ctx, cfg *IssueConfig) (err error) + func ArtificialPREvent(c *sql.DB, ctx *Ctx, cfg *IssueConfig, pr *github.PullRequest) (err error) + func BoolOrNil(boolPtr *bool) interface + func CleanUTF8(str string) string + func ClearDBLogs() + func CommentIDOrNil(commPtr *Comment) interface + func CompareFloat64Ptr(p1, p2 *float64) bool + func CompareIntPtr(p1, p2 *int) bool + func CompareStringPtr(p1, p2 *string) bool + func ComputePeriodAtThisDate(ctx *Ctx, period string, idt time.Time, hist bool) bool + func CreateDatabaseIfNeeded(ctx *Ctx) bool + func CreateDatabaseIfNeededExtended(ctx *Ctx, extraParams string) bool + func CreateTable(tdef string) string + func DatabaseExists(ctx *Ctx, closeConn bool) (exists bool, c *sql.DB) + func DayStart(dt time.Time) time.Time + func DeleteArtificialEvent(c *sql.DB, ctx *Ctx, cfg *IssueConfig) (err error) + func DeleteArtificialPREvent(c *sql.DB, ctx *Ctx, cfg *IssueConfig) (err error) + func DescriblePeriodInHours(hrs float64) (desc string) + func DropDatabaseIfExists(ctx *Ctx) bool + func EnvReplace(prefix, suffix string) map[string]string + func EnvRestore(env map[string]string) + func ExecCommand(ctx *Ctx, cmdAndArgs []string, env map[string]string) (string, error) + func ExecSQL(con *sql.DB, ctx *Ctx, query string, args ...interface{}) (sql.Result, error) + func ExecSQLTx(con *sql.Tx, ctx *Ctx, query string, args ...interface{}) (sql.Result, error) + func ExecSQLTxWithErr(con *sql.Tx, ctx *Ctx, query string, args ...interface{}) sql.Result + func ExecSQLWithErr(con *sql.DB, ctx *Ctx, query string, args ...interface{}) sql.Result + func FatalNoLog(err error) string + func FatalOnError(err error) string + func Fatalf(f string, a ...interface{}) + func FirstIntOrNil(intPtrs []*int) interface + func ForkeeIDOrNil(forkPtr *Forkee) interface + func ForkeeNameOrNil(forkPtr *Forkee) interface + func ForkeeOldIDOrNil(forkPtr *ForkeeOld) interface + func GHClient(ctx *Ctx) (ghCtx context.Context, clients []*github.Client) + func GetDateAgo(con *sql.DB, ctx *Ctx, from time.Time, ago string) (tm time.Time) + func GetFloatFromInterface(i interface{}) (float64, bool) + func GetHidden(configFile string) map[string]string + func GetIntervalFunctions(intervalAbbr string, allowUnknown bool) (interval string, n int, ...) + func GetRateLimits(gctx context.Context, ctx *Ctx, gcs []*github.Client, core bool) (int, []int, []int, []time.Duration) + func GetRecentRepos(c *sql.DB, ctx *Ctx, dtFrom time.Time) (repos []string, rids []int64) + func GetTagValues(con *sql.DB, ctx *Ctx, name, key string) (ret []string) + func GetThreadsNum(ctx *Ctx) int + func HandlePossibleError(err error, cfg, info string) string + func HashArray(ia []interface{}) string + func HashObject(iv map[string]interface{}, keys []string) string + func HashStrings(strs []string) int + func HourStart(dt time.Time) time.Time + func InsertIgnore(query string) string + func IntOrNil(intPtr *int) interface + func IsProjectDisabled(ctx *Ctx, proj string, yamlDisabled bool) bool + func IssueIDOrNil(issuePtr *Issue) interface + func MakeOldRepoName(repo *ForkeeOld) string + func MakeUniqueSort(ary []string) (outAry []string) + func MapFromString(str string) map[string]string + func MaybeHideFunc(shas map[string]string) func(string) string + func Mgetc(ctx *Ctx) string + func MilestoneIDOrNil(milPtr *Milestone) interface + func MonthStart(dt time.Time) time.Time + func NValue(index int) string + func NValues(n int) string + func NegatedBoolOrNil(boolPtr *bool) interface + func NextDayStart(dt time.Time) time.Time + func NextHourStart(dt time.Time) time.Time + func NextMonthStart(dt time.Time) time.Time + func NextQuarterStart(dt time.Time) time.Time + func NextWeekStart(dt time.Time) time.Time + func NextYearStart(dt time.Time) time.Time + func NormalizeName(str string) string + func ObjectToJSON(obj interface{}, fn string) + func ObjectToYAML(obj interface{}, fn string) + func OrgIDOrNil(orgPtr *Org) interface + func OrgLoginOrNil(orgPtr *Org) interface + func PeriodParse(perStr string) (dur time.Duration, ok bool) + func PgConn(ctx *Ctx) *sql.DB + func PgConnDB(ctx *Ctx, dbName string) *sql.DB + func PrepareQuickRangeQuery(sql, period, from, to string) string + func PrettyPrintJSON(jsonBytes []byte) []byte + func PrevDayStart(dt time.Time) time.Time + func PrevHourStart(dt time.Time) time.Time + func PrevMonthStart(dt time.Time) time.Time + func PrevQuarterStart(dt time.Time) time.Time + func PrevWeekStart(dt time.Time) time.Time + func PrevYearStart(dt time.Time) time.Time + func Printf(format string, args ...interface{}) (n int, err error) + func ProcessAnnotations(ctx *Ctx, annotations *Annotations, startDate, joinDate *time.Time) + func ProcessTag(con *sql.DB, es *ES, ctx *Ctx, tg *Tag, replaces [][]string) + func ProgressInfo(i, n int, start time.Time, last *time.Time, period time.Duration, msg string) + func PullRequestIDOrNil(prPtr *PullRequest) interface + func QuarterStart(dt time.Time) time.Time + func QueryRowSQL(con *sql.DB, ctx *Ctx, query string, args ...interface{}) *sql.Row + func QueryRowSQLTx(tx *sql.Tx, ctx *Ctx, query string, args ...interface{}) *sql.Row + func QuerySQL(con *sql.DB, ctx *Ctx, query string, args ...interface{}) (*sql.Rows, error) + func QuerySQLTx(con *sql.Tx, ctx *Ctx, query string, args ...interface{}) (*sql.Rows, error) + func QuerySQLTxWithErr(con *sql.Tx, ctx *Ctx, query string, args ...interface{}) *sql.Rows + func QuerySQLWithErr(con *sql.DB, ctx *Ctx, query string, args ...interface{}) *sql.Rows + func ReadFile(ctx *Ctx, path string) ([]byte, error) + func ReleaseIDOrNil(relPtr *Release) interface + func RepoHit(ctx *Ctx, fullName string, forg, frepo map[string]struct{}) bool + func RepoIDOrNil(repoPtr *Repo) interface + func RepoNameOrNil(repoPtr *Repo) interface + func SkipEmpty(arr []string) []string + func Slugify(arg string) string + func StringOrNil(strPtr *string) interface + func StringsMapToArray(f func(string) string, strArr []string) []string + func StringsMapToSet(f func(string) string, strArr []string) map[string]struct + func StringsSetKeys(set map[string]struct{}) []string + func StripUnicode(str string) string + func Structure(ctx *Ctx) + func SyncIssuesState(gctx context.Context, gc []*github.Client, ctx *Ctx, c *sql.DB, ...) + func TableColumnExists(con *sql.DB, ctx *Ctx, tableName, columnName string) bool + func TableExists(con *sql.DB, ctx *Ctx, tableName string) bool + func TimeOrNil(timePtr *time.Time) interface + func TimeParseAny(dtStr string) time.Time + func ToGHADate(dt time.Time) string + func ToYMDDate(dt time.Time) string + func ToYMDHDate(dt time.Time) string + func ToYMDHMSDate(dt time.Time) string + func TruncStringOrNil(strPtr *string, maxLen int) interface + func TruncToBytes(str string, size int) string + func WeekStart(dt time.Time) time.Time + func WriteTSPoints(ctx *Ctx, con *sql.DB, pts *TSPoints, mergeSeries string, mut *sync.Mutex) + func YearStart(dt time.Time) time.Time + type Actor struct + ID int + Login string + Name string + type AllProjects struct + Projects map[string]Project + type Annotation struct + Date time.Time + Description string + Name string + type Annotations struct + Annotations []Annotation + func GetAnnotations(ctx *Ctx, orgRepo, annoRegexp string) (annotations Annotations) + func GetFakeAnnotations(startDate, joinDate time.Time) (annotations Annotations) + type AnnotationsByDate []Annotation + func (a AnnotationsByDate) Len() int + func (a AnnotationsByDate) Less(i, j int) bool + func (a AnnotationsByDate) Swap(i, j int) + type AnyArray []interface + type Asset struct + ContentType string + CreatedAt time.Time + DownloadCount int + ID int + Label *string + Name string + Size int + State string + UpdatedAt time.Time + Uploader Actor + type Author struct + Email string + Name string + type Branch struct + Label string + Ref string + Repo *Forkee + SHA string + User *Actor + type Comment struct + Body string + CommitID *string + CreatedAt time.Time + DiffHunk *string + ID int + Line *int + OriginalCommitID *string + OriginalPosition *int + Path *string + Position *int + PullRequestReviewID *int + UpdatedAt time.Time + User Actor + type Commit struct + Author Author + Distinct bool + Message string + SHA string + type Ctx struct + ActorsAllow *regexp.Regexp + ActorsFilter bool + ActorsForbid *regexp.Regexp + AffiliationsJSON string + AllowBrokenJSON bool + AutoFetchCommits bool + CSVFile string + CheckPayload bool + CheckProvisionFlag bool + CheckRunningFlag bool + ClearDBPeriod string + CmdDebug int + ColumnsYaml string + CompanyAcqYaml string + ComputeAll bool + ComputePeriods map[string]map[bool]struct{} + CtxOut bool + DBOut bool + DataDir string + Debug int + DefaultHostname string + DefaultStartDate time.Time + DeployBranches []string + DeployResults []int + DeployStatuses []string + DeployTypes []string + DryRun bool + ESBulkSize int + ElasticURL string + Exact bool + ExcludeRepos map[string]bool + ExcludeVars map[string]bool + ExecFatal bool + ExecOutput bool + ExecQuiet bool + Explain bool + ExternalInfo bool + ForceStartDate bool + FullDeploy bool + GHAPIErrorIsFatal bool + GitHubDebug int + GitHubOAuth string + HTTPTimeout int + Index bool + InputDBs []string + JSONOut bool + JSONsDir string + LastSeries string + Local bool + LocalCmd bool + LogTime bool + LogToDB bool + MaxGHAPIRetry int + MaxGHAPIWaitSeconds int + MetricsYaml string + Mgetc string + MinGHAPIPoints int + NCPUs int + OldFormat bool + OnlyMetrics map[string]bool + OnlyVars map[string]bool + OutputDB string + PgDB string + PgHost string + PgPass string + PgPort string + PgSSL string + PgUser string + PidFileRoot string + ProcessCommits bool + ProcessRepos bool + Project string + ProjectMainRepo string + ProjectRoot string + ProjectsCommits string + ProjectsOverride map[string]bool + ProjectsYaml string + PropagateOnlyVar bool + QOut bool + RecentRange string + RecentReposRange string + ReposDir string + ResetESRaw bool + ResetRanges bool + ResetTSDB bool + RunColumns bool + ST bool + SetRunningFlag bool + SharedDB string + SkipAPICommits bool + SkipAPIEvents bool + SkipAnnotations bool + SkipColumns bool + SkipCompanyAcq bool + SkipDatesYaml string + SkipGHAPI bool + SkipGetRepos bool + SkipMetrics map[string]bool + SkipPDB bool + SkipPIDFile bool + SkipSharedDB bool + SkipTSDB bool + SkipTags bool + SkipUpdateEvents bool + SkipVars bool + Table bool + TagsYaml string + TestMode bool + TestsYaml string + TmOffset int + Tools bool + Trials []int + UseES bool + UseESOnly bool + UseESRaw bool + VarsFnYaml string + VarsYaml string + WebHookHost string + WebHookPort string + WebHookRoot string + WebsiteData bool + func (ctx *Ctx) Init() + func (ctx *Ctx) Print() + type Dummy struct + type ES struct + func ESConn(ctx *Ctx, prefix string) *ES + func (es *ES) AddBulksItems(ctx *Ctx, b *ESBulks, doc map[string]interface{}, keys []string) + func (es *ES) AddBulksItemsI(ctx *Ctx, b *ESBulks, doc interface{}, docHash string) + func (es *ES) Bulks() (*elastic.BulkService, *elastic.BulkService) + func (es *ES) CreateIndex(ctx *Ctx, raw bool) + func (es *ES) DeleteByQuery(ctx *Ctx, propNames []string, propValues []interface{}) + func (es *ES) DeleteByWildcardQuery(ctx *Ctx, propName, propQuery string) + func (es *ES) ESEscapeFieldName(fieldName string) string + func (es *ES) ESIndexName(ctx *Ctx) string + func (es *ES) ExecuteBulkAdd(ctx *Ctx, bulkAdd *elastic.BulkService) + func (es *ES) ExecuteBulkDel(ctx *Ctx, bulkDel *elastic.BulkService) + func (es *ES) ExecuteBulks(ctx *Ctx, b *ESBulks) + func (es *ES) GetElasticClient() *elastic.Client + func (es *ES) IndexExists(ctx *Ctx) bool + func (es *ES) WriteESPoints(ctx *Ctx, pts *TSPoints, mergeS string, outputs [3]bool) + type ESBulks struct + func (b *ESBulks) CurrentAdd() *elastic.BulkService + func (b *ESBulks) CurrentDel() *elastic.BulkService + func (b *ESBulks) Init(ec *elastic.Client, ctx *Ctx) + func (b *ESBulks) Next(ec *elastic.Client) + func (b *ESBulks) String() string + type ESDataObject struct + DtValue time.Time + IValue float64 + Name string + SValue string + SValue2 string + SValue3 string + type Event struct + Actor Actor + CreatedAt time.Time + ID string + Org *Org + Payload Payload + Public bool + Repo Repo + Type string + type EventOld struct + Actor string + CreatedAt time.Time + ID string + Payload *PayloadOld + Public bool + Repository ForkeeOld + Type string + type Forkee struct + CreatedAt time.Time + DefaultBranch string + Description *string + Fork bool + Forks int + FullName string + HasDownloads bool + HasIssues bool + HasPages *bool + HasProjects *bool + HasWiki bool + Homepage *string + ID int + Name string + OpenIssues int + Owner Actor + Public *bool + PushedAt *time.Time + Size int + StargazersCount int + UpdatedAt time.Time + Watchers int + type ForkeeOld struct + CreatedAt time.Time + DefaultBranch string + Description *string + Fork bool + Forks int + HasDownloads bool + HasIssues bool + HasWiki bool + Homepage *string + ID int + Language *string + Name string + OpenIssues int + Organization *string + Owner string + Private *bool + PushedAt *time.Time + Size int + Stargazers int + Watchers int + type Int64Ary []int64 + func (a Int64Ary) Len() int + func (a Int64Ary) Less(i, j int) bool + func (a Int64Ary) Swap(i, j int) + type Issue struct + Assignee *Actor + Assignees []Actor + Body *string + ClosedAt *time.Time + Comments int + CreatedAt time.Time + ID int + Labels []Label + Locked bool + Milestone *Milestone + Number int + PullRequest *Dummy + State string + Title string + UpdatedAt time.Time + User Actor + type IssueConfig struct + AssigneeID *int64 + Assignees string + AssigneesMap map[int64]string + CreatedAt time.Time + EventID int64 + EventType string + GhEvent *github.IssueEvent + GhIssue *github.Issue + IssueID int64 + Labels string + LabelsMap map[int64]string + MilestoneID *int64 + Number int + Pr bool + Repo string + func (ic IssueConfig) String() string + type IssueConfigAry []IssueConfig + func (ic IssueConfigAry) Len() int + func (ic IssueConfigAry) Less(i, j int) bool + func (ic IssueConfigAry) Swap(i, j int) + type Label struct + Color string + Default *bool + ID *int + Name string + type Milestone struct + ClosedAt *time.Time + ClosedIssues int + CreatedAt time.Time + Creator *Actor + Description *string + DueOn *time.Time + ID int + Name string + Number int + OpenIssues int + State string + Title string + UpdatedAt time.Time + type Org struct + ID int + Login string + type Page struct + Action string + SHA string + Title string + type Payload struct + Action *string + Before *string + Comment *Comment + Commits *[]Commit + Description *string + Forkee *Forkee + Head *string + Issue *Issue + MasterBranch *string + Member *Actor + Number *int + Pages *[]Page + PullRequest *PullRequest + PushID *int + Ref *string + RefType *string + Release *Release + Size *int + type PayloadOld struct + Action *string + Comment *Comment + CommentID *int + Commit *string + Description *string + Head *string + Issue *int + IssueID *int + MasterBranch *string + Member *Actor + Number *int + Pages *[]Page + PullRequest *PullRequest + Ref *string + RefType *string + Release *Release + Repository *Forkee + SHAs *[]interface{} + Size *int + Team *Team + type Project struct + AnnotationRegexp string + CommandLine []string + Disabled bool + Env map[string]string + FilesSkipPattern string + FullName string + JoinDate *time.Time + MainRepo string + Order int + PDB string + SharedDB string + StartDate *time.Time + Status string + func GetProjectsList(ctx *Ctx, projects *AllProjects) (names []string, projs []Project) + type PullRequest struct + Additions *int + Assignee *Actor + Assignees *[]Actor + Base Branch + Body *string + ChangedFiles *int + ClosedAt *time.Time + Comments *int + Commits *int + CreatedAt time.Time + Deletions *int + Head Branch + ID int + Locked *bool + MaintainerCanModify *bool + MergeCommitSHA *string + Mergeable *bool + MergeableState *string + Merged *bool + MergedAt *time.Time + MergedBy *Actor + Milestone *Milestone + Number int + Rebaseable *bool + RequestedReviewers *[]Actor + ReviewComments *int + State string + Title string + UpdatedAt time.Time + User Actor + type Release struct + Assets []Asset + Author Actor + Body *string + CreatedAt time.Time + Draft bool + ID int + Name *string + Prerelease bool + PublishedAt *time.Time + TagName string + TargetCommitish string + type Repo struct + ID int + Name string + type SkipDatesList struct + Dates []time.Time + type TSPoint struct + func NewTSPoint(ctx *Ctx, name, period string, tags map[string]string, ...) TSPoint + func (p *TSPoint) Str() string + type TSPoints []TSPoint + func (ps *TSPoints) Str() string + type Tag struct + Disabled bool + Limit int + Name string + NameTag string + OtherTags map[string][2]string + SQLFile string + SeriesName string + ValueTag string + type Tags struct + Tags []Tag + type Team struct + ID int + Name string + Permission string + Slug string