Documentation
¶
Index ¶
- Constants
- func GetCurDayStr() string
- func GetCustomDayStr(format string) (string, error)
- func GetRelDayStr(relDays int) string
- func GoUpdateActivityWrap(update ActivityUpdate, debugStr string)
- func IsAllowedRenderer(renderer string) bool
- func MarkActivityAsUploaded(ctx context.Context, activityArr []*ActivityType) error
- func UpdateActivity(ctx context.Context, update ActivityUpdate) error
- func UpdateFeActivityWrap(feActivity *scpacket.FeActivityPacketType)
- type ActivityType
- type ActivityUpdate
- type TelemetryData
Constants ¶
View Source
const MaxTzNameLen = 50
Variables ¶
This section is empty.
Functions ¶
func GetCurDayStr ¶
func GetCurDayStr() string
func GetCustomDayStr ¶
accepts a custom format string to return a daystr can be either a prefix, a delta, or a prefix w/ a delta if no prefix is given, "today" is assumed examples: today-2d, bow, bom+1m-1d (that's end of the month), 2024-04-01+1w
prefixes:
yyyy-mm-dd today yesterday bom (beginning of month) bow (beginning of week -- sunday)
deltas:
+[n]d, -[n]d (e.g. +1d, -5d) +[n]w, -[n]w (e.g. +2w) +[n]m, -[n]m (e.g. -1m) deltas can be combined e.g. +1w-2d
func GetRelDayStr ¶
func GoUpdateActivityWrap ¶
func GoUpdateActivityWrap(update ActivityUpdate, debugStr string)
Wraps UpdateCurrentActivity, spawns goroutine, and logs errors
func IsAllowedRenderer ¶
func MarkActivityAsUploaded ¶
func MarkActivityAsUploaded(ctx context.Context, activityArr []*ActivityType) error
note, will not mark the current day as uploaded
func UpdateActivity ¶
func UpdateActivity(ctx context.Context, update ActivityUpdate) error
func UpdateFeActivityWrap ¶
func UpdateFeActivityWrap(feActivity *scpacket.FeActivityPacketType)
Types ¶
type ActivityType ¶
type ActivityType struct { Day string `json:"day"` Uploaded bool `json:"-"` TData TelemetryData `json:"tdata"` TzName string `json:"tzname"` TzOffset int `json:"tzoffset"` ClientVersion string `json:"clientversion"` ClientArch string `json:"clientarch"` BuildTime string `json:"buildtime"` DefaultShell string `json:"defaultshell"` OSRelease string `json:"osrelease"` }
func GetNonUploadedActivity ¶
func GetNonUploadedActivity(ctx context.Context) ([]*ActivityType, error)
type ActivityUpdate ¶
type ActivityUpdate struct { FgMinutes int ActiveMinutes int OpenMinutes int NumCommands int HistoryView int BookmarksView int NumConns int NumWorkspaces int NumTabs int NewTab int ReinitBashErrors int ReinitZshErrors int Startup int Shutdown int FeAIChatOpen int FeHistoryOpen int FeAiCmdInfoOpen int BuildTime string Renderers map[string]int }
type TelemetryData ¶
type TelemetryData struct { NumCommands int `json:"numcommands"` ActiveMinutes int `json:"activeminutes"` FgMinutes int `json:"fgminutes"` OpenMinutes int `json:"openminutes"` HistoryView int `json:"historyview,omitempty"` BookmarksView int `json:"bookmarksview,omitempty"` NumConns int `json:"numconns"` NumWorkspaces int `json:"numworkspaces"` NumTabs int `json:"numtabs"` NewTab int `json:"newtab"` NumStartup int `json:"numstartup,omitempty"` NumShutdown int `json:"numshutdown,omitempty"` NumAIChatOpen int `json:"numaichatopen,omitempty"` NumHistoryOpen int `json:"numhistoryopen,omitempty"` ReinitBashErrors int `json:"reinitbasherrors,omitempty"` ReinitZshErrors int `json:"reinitzsherrors,omitempty"` Renderers map[string]int `json:"renderers,omitempty"` }
func (*TelemetryData) Scan ¶
func (tdata *TelemetryData) Scan(val interface{}) error
Click to show internal directories.
Click to hide internal directories.