Documentation
¶
Index ¶
Constants ¶
const ( TypePieChart DashboardType = "piechart" TypeBarChart DashboardType = "barchart" TypeLineChart DashboardType = "linechart" HorizontalTable DashboardType = "horizontaltable" VerticalTable DashboardType = "verticaltable" TypeStackedBarChart DashboardType = "stackedbarchart" IntervalHourly Interval = "hourly" IntervalDaily Interval = "daily" IntervalWeekly Interval = "weekly" IntervalMonthly Interval = "monthly" IntervalYearly Interval = "yearly" IntervalSingle Interval = "single" NoRangeIDDefined = -1 )
No lint errors please.
const ( ThemeGruvboxDark = "GruvboxDark" ThemeGruvboxLight = "GruvboxLight" ThemeMaterialDark = "MaterialDark" ThemeMaterialLight = "MaterialLight" DateLocaleGerman = "German" DateLocaleAmerican = "American" DateLocaleAmerican24h = "American24h" DateLocaleBritish = "British" DateLocaleAustralian = "Australian" )
Settings constants
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Dashboard ¶
type Dashboard struct {
ID int `gorm:"primary_key;unique_index;AUTO_INCREMENT"`
UserID int `gorm:"type:int REFERENCES users(id) ON DELETE CASCADE"`
Name string
Entries []DashboardEntry
Ranges []DashboardRange
}
Dashboard a dashboard
type DashboardEntry ¶
type DashboardEntry struct {
ID int `gorm:"primary_key;unique_index;AUTO_INCREMENT"`
DashboardID int `gorm:"type:int REFERENCES dashboards(id) ON DELETE CASCADE"`
Title string
Type DashboardType
Keys string
Interval Interval
RangeID int
RangeFrom string
RangeTo string
MobilePosition string
DesktopPosition string
}
DashboardEntry an entry which represents a diagram in a dashboard.
type DashboardRange ¶
type DashboardRange struct {
ID int `gorm:"primary_key;unique_index;AUTO_INCREMENT"`
Name string
DashboardID int `gorm:"type:int REFERENCES dashboards(id) ON DELETE CASCADE"`
Editable bool
From string
To string
}
DashboardRange a named range of a dashboard.
type Device ¶
type Device struct {
ID int `gorm:"primary_key;unique_index;AUTO_INCREMENT"`
Token string `gorm:"unique"`
Name string
UserID int `gorm:"type:int REFERENCES users(id) ON DELETE CASCADE"`
CreatedAt time.Time
Type DeviceType
ActiveAt time.Time
}
Device represents something which can connect to traggo
type DeviceType ¶
type DeviceType string
DeviceType the device type
const ( TypeShortExpiry DeviceType = "ShortExpiry" TypeLongExpiry DeviceType = "LongExpiry" TypeNoExpiry DeviceType = "NoExpiry" )
Device types
func (DeviceType) Seconds ¶
func (t DeviceType) Seconds() int
Seconds returns the amount of seconds after the device expires.
func (DeviceType) Valid ¶
func (t DeviceType) Valid() error
Valid checks if the device type is valid.
type Interval ¶
type Interval string
Interval the interval in which the diagram data should be grouped.
type TagDefinition ¶
type TagDefinition struct {
Key string
UserID int `gorm:"type:int REFERENCES users(id) ON DELETE CASCADE"`
Color string
Usages int `gorm:"-"`
}
TagDefinition describes a tag.
type Time ¶
Time scalar type for graphql
func (Time) MarshalGQL ¶
MarshalGQL implements the graphql.Marshaler interface
func (Time) OmitTimeZone ¶
OmitTimeZone omits the time zone and removes a utc date.
func (*Time) UnmarshalGQL ¶
UnmarshalGQL implements the graphql.Unmarshaler interface
type TimeSpan ¶
type TimeSpan struct {
ID int `gorm:"primary_key;unique_index;AUTO_INCREMENT"`
StartUTC time.Time
EndUTC *time.Time
StartUserTime time.Time
EndUserTime *time.Time
OffsetUTC int
UserID int `gorm:"type:int REFERENCES users(id) ON DELETE CASCADE"`
Tags []TimeSpanTag
Note string
}
TimeSpan is basically a tagged time range.
type TimeSpanTag ¶
type TimeSpanTag struct {
TimeSpanID int `gorm:"type:int REFERENCES time_spans(id) ON DELETE CASCADE"`
Key string
StringValue string
}
TimeSpanTag is a tag for a time range
type User ¶
type User struct {
ID int `gorm:"primary_key;unique_index;AUTO_INCREMENT"`
Name string `gorm:"unique"`
Pass []byte
Admin bool
}
User holds information about credentials and authorizations.
type UserSetting ¶
type UserSetting struct {
UserID int `gorm:"primary_key;unique_index"`
Theme string
DateLocale string
FirstDayOfTheWeek string
}
UserSetting a setting for a user.
func (UserSetting) FirstDayOfTheWeekTimeWeekday ¶
func (s UserSetting) FirstDayOfTheWeekTimeWeekday() time.Weekday
FirstDayOfTheWeekTimeWeekday returns the configured first day of the week.
func (UserSetting) LastDayOfTheWeekTimeWeekday ¶
func (s UserSetting) LastDayOfTheWeekTimeWeekday() time.Weekday
LastDayOfTheWeekTimeWeekday returns the configured last day of the week.