Documentation ¶
Index ¶
- func LogDebug()
- func ModelTime(value string) model.Time
- func ModelTimeP(value string) *model.Time
- func ModelTimeUTC(value string) model.Time
- func Time(value string) time.Time
- func TimeP(value string) *time.Time
- type DashboardWithDatabase
- func (d *DashboardWithDatabase) AssertExists(exist bool) *DashboardWithDatabase
- func (d *DashboardWithDatabase) AssertHasEntry(name string, exist bool) *DashboardWithDatabase
- func (d *DashboardWithDatabase) AssertHasRange(name string, exist bool) *DashboardWithDatabase
- func (d *DashboardWithDatabase) Entry(name string) *DashboardWithDatabase
- func (d *DashboardWithDatabase) Range(name string) *DashboardWithDatabase
- type Database
- type Entry
- type Logger
- type TimeSpanWithDatabase
- func (d *TimeSpanWithDatabase) AssertExists(exist bool) *TimeSpanWithDatabase
- func (d *TimeSpanWithDatabase) AssertHasTag(key, value string, exist bool) *TimeSpanWithDatabase
- func (d *TimeSpanWithDatabase) AssertHasTagIgnoreValue(key string, exist bool) *TimeSpanWithDatabase
- func (d *TimeSpanWithDatabase) Tag(key string, stringValue string) *TimeSpanWithDatabase
- type UserWithDatabase
- func (d *UserWithDatabase) AssertExists(exist bool) *UserWithDatabase
- func (d *UserWithDatabase) AssertHasDevice(name string, exist bool) *UserWithDatabase
- func (d *UserWithDatabase) AssertHasTagDefinition(key string, exist bool) *UserWithDatabase
- func (d *UserWithDatabase) Dashboard(name string) *DashboardWithDatabase
- func (d *UserWithDatabase) NewDevice(id int, token string, name string) model.Device
- func (d *UserWithDatabase) NewTagDefinition(key string) model.TagDefinition
- func (d *UserWithDatabase) RunningTimeSpan(from string) *TimeSpanWithDatabase
- func (d *UserWithDatabase) TimeSpan(from string, to string) *TimeSpanWithDatabase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ModelTimeP ¶
ModelTimeP parses a model.Time panics if not valid
func ModelTimeUTC ¶
ModelTimeUTC parses a model.Time in utc time. panics if not valid
Types ¶
type DashboardWithDatabase ¶
type DashboardWithDatabase struct { User model.User Dashboard model.Dashboard *gorm.DB // contains filtered or unexported fields }
DashboardWithDatabase wraps gorm.DB and provides helper methods
func (*DashboardWithDatabase) AssertExists ¶
func (d *DashboardWithDatabase) AssertExists(exist bool) *DashboardWithDatabase
AssertExists asserts if the dashboard exists or not.
func (*DashboardWithDatabase) AssertHasEntry ¶
func (d *DashboardWithDatabase) AssertHasEntry(name string, exist bool) *DashboardWithDatabase
AssertHasEntry asserts if the entry exists or not.
func (*DashboardWithDatabase) AssertHasRange ¶
func (d *DashboardWithDatabase) AssertHasRange(name string, exist bool) *DashboardWithDatabase
AssertHasRange asserts if the range exists or not.
func (*DashboardWithDatabase) Entry ¶
func (d *DashboardWithDatabase) Entry(name string) *DashboardWithDatabase
Entry adds an entry to the dashboard.
func (*DashboardWithDatabase) Range ¶
func (d *DashboardWithDatabase) Range(name string) *DashboardWithDatabase
Range adds a range to the dashboard.
type Database ¶
Database wraps the gorm.DB and provides helper methods
func InMemoryDB ¶
InMemoryDB create a in memory database for testing.
func (*Database) NewUserPass ¶
NewUserPass creates a user
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger the test logger with util methods
func (*Logger) AssertCount ¶
AssertCount asserts the amount of recorded logging entries
func (*Logger) AssertEntryExists ¶
AssertEntryExists asserts that a logging entry exists
type TimeSpanWithDatabase ¶
type TimeSpanWithDatabase struct { User model.User TimeSpan model.TimeSpan *gorm.DB // contains filtered or unexported fields }
TimeSpanWithDatabase wraps gorm.DB and provides helper methods
func (*TimeSpanWithDatabase) AssertExists ¶
func (d *TimeSpanWithDatabase) AssertExists(exist bool) *TimeSpanWithDatabase
AssertExists asserts if the tag exists or not.
func (*TimeSpanWithDatabase) AssertHasTag ¶
func (d *TimeSpanWithDatabase) AssertHasTag(key, value string, exist bool) *TimeSpanWithDatabase
AssertHasTag asserts if the tag exists or not.
func (*TimeSpanWithDatabase) AssertHasTagIgnoreValue ¶
func (d *TimeSpanWithDatabase) AssertHasTagIgnoreValue(key string, exist bool) *TimeSpanWithDatabase
AssertHasTagIgnoreValue asserts if the tag exists or not.
func (*TimeSpanWithDatabase) Tag ¶
func (d *TimeSpanWithDatabase) Tag(key string, stringValue string) *TimeSpanWithDatabase
Tag adds a tag to the time span.
type UserWithDatabase ¶
UserWithDatabase wraps gorm.DB and provides helper methods
func (*UserWithDatabase) AssertExists ¶
func (d *UserWithDatabase) AssertExists(exist bool) *UserWithDatabase
AssertExists asserts if the tag exists or not.
func (*UserWithDatabase) AssertHasDevice ¶
func (d *UserWithDatabase) AssertHasDevice(name string, exist bool) *UserWithDatabase
AssertHasDevice asserts if a device exists.
func (*UserWithDatabase) AssertHasTagDefinition ¶
func (d *UserWithDatabase) AssertHasTagDefinition(key string, exist bool) *UserWithDatabase
AssertHasTagDefinition asserts if a tag definition exists.
func (*UserWithDatabase) Dashboard ¶
func (d *UserWithDatabase) Dashboard(name string) *DashboardWithDatabase
Dashboard adds a dashboard.
func (*UserWithDatabase) NewTagDefinition ¶
func (d *UserWithDatabase) NewTagDefinition(key string) model.TagDefinition
NewTagDefinition creates a tag definition.
func (*UserWithDatabase) RunningTimeSpan ¶
func (d *UserWithDatabase) RunningTimeSpan(from string) *TimeSpanWithDatabase
RunningTimeSpan adds a time span without end.
func (*UserWithDatabase) TimeSpan ¶
func (d *UserWithDatabase) TimeSpan(from string, to string) *TimeSpanWithDatabase
TimeSpan adds a time span.