types

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package types defines the shared domain vocabulary for gitrakz — events, sessions, form values — as plain data structs. It has no behavior and no dependencies beyond the standard library, so every other package can depend on it without pulling anything else in.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	ID        string          `json:"id"`
	TS        int64           `json:"ts"`
	Type      EventType       `json:"type"`
	Owner     string          `json:"owner"`
	Repo      string          `json:"repo"`
	SHA       string          `json:"sha"`
	Number    int             `json:"number"`
	Title     string          `json:"title"`
	URL       string          `json:"url"`
	Additions int             `json:"additions"`
	Deletions int             `json:"deletions"`
	Branch    string          `json:"branch"`
	Raw       json.RawMessage `json:"raw"`
}

Event is a single unit of GitHub activity — a commit, PR, review, issue, or release — normalized into one shape for storage and display.

type EventType

type EventType string

EventType identifies the kind of GitHub activity an Event represents.

const (
	EventTypeCommit  EventType = "commit"
	EventTypePR      EventType = "pr"
	EventTypeReview  EventType = "review"
	EventTypeIssue   EventType = "issue"
	EventTypeRelease EventType = "release"
)

type FormValues

type FormValues = map[string]any

FormValues holds the arbitrary input a template's form collects at run time — off-hours schedule, rate, lead-in, or whatever fields the template declares.

type OffHours

type OffHours = []OffWindow

OffHours is the set of OffWindow entries excluded from time-based calculations (e.g. lunch breaks, end-of-day cutoffs) for a given day.

type OffWindow

type OffWindow struct {
	StartMinute int `json:"startMinute"`
	EndMinute   int `json:"endMinute"`
}

OffWindow is a single off-hours interval within a day. StartMinute and EndMinute are both minutes-of-day in the range [0, 1440) — 1440 being the number of minutes in a day.

type Session

type Session struct {
	Owner           string `json:"owner"`
	Repo            string `json:"repo"`
	Start           int64  `json:"start"`
	End             int64  `json:"end"`
	DurationSeconds int64  `json:"durationSeconds"`
	EventCount      int    `json:"eventCount"`
}

Session is a derived cluster of events treated as one continuous block of work.

type Timeline

type Timeline = []Event

Timeline is an ordered collection of events.

Jump to

Keyboard shortcuts

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