Documentation
¶
Index ¶
- Constants
- Variables
- func AreTagsValid(tags []domain.Tag) bool
- func AutoMigrateTables() error
- func CreateForeignKeys() error
- func DeleteItem(itemObj interface{}, id uint) error
- func DeleteOrphanedItems(itemObj interface{}, relationID string)
- func DropTables() error
- func FindOne(itemObj interface{}) error
- func GetAuthorizationStatus(req events.APIGatewayProxyRequest, permissionType string, ...) (int, string)
- func GetCountryByCode(countryCode string) (domain.Country, error)
- func GetDb() (*gorm.DB, error)
- func GetItem(itemObj interface{}, id uint) error
- func GetLatestVersion() (domain.Version, error)
- func GetNodeByMacAddr(macAddr string) (domain.Node, error)
- func GetReportingEvents(nodeID uint) ([]domain.ReportingEvent, error)
- func GetReportingEventsForRange(nodeId uint, rangeStart, rangeEnd int64) ([]domain.ReportingEvent, error)
- func GetSnapshotsForRange(interval string, nodeId uint, rangeStart, rangeEnd int64) ([]domain.ReportingSnapshot, error)
- func GetSpeedTestNetServerByServerID(serverID string) (domain.SpeedTestNetServer, error)
- func GetTaskLogForRange(itemObj interface{}, nodeId uint, rangeStart, rangeEnd int64) error
- func GetUserFromRequest(req events.APIGatewayProxyRequest) (domain.User, error)
- func ListItems(itemObj interface{}, order string) error
- func ListMIANodes(daysMissing int) ([]domain.Node, error)
- func ListNamedServersByType(serverType string) ([]domain.NamedServer, error)
- func PutItem(itemObj interface{}) error
- func PutItemWithAssociations(itemObj interface{}, replacements []domain.AssociationReplacements) error
Constants ¶
View Source
const CASCADE = "CASCADE"
View Source
const MYSQL_NULL = "null"
View Source
const NOACTION = "NO ACTION"
View Source
const RESTRICT = "RESTRICT"
View Source
const RelatedTaskErrorCode = "Error 1451"
View Source
const SETNULL = "SET NULL"
View Source
const UniqueFieldErrorCode = "Error 1062"
Variables ¶
View Source
var DatabaseTables = []interface{}{
&domain.Contact{}, &domain.Country{}, &domain.Tag{}, &domain.Task{}, &domain.SpeedTestNetServer{},
&domain.UserTags{}, &domain.User{}, &domain.Version{}, &domain.TaskLogSpeedTest{},
&domain.TaskLogPingTest{}, &domain.TaskLogError{}, &domain.TaskLogRestart{}, &domain.TaskLogNetworkDowntime{},
&domain.ReportingSnapshot{}, &domain.NamedServer{}, &domain.NodeTags{}, &domain.Node{}, &domain.ReportingEvent{}}
View Source
var Db *gorm.DB
Functions ¶
func AreTagsValid ¶
func AreTagsValid(tags []domain.Tag) bool
AreTagsValid returns a bool based on this ...
- if the input is empty, then true
- if there is an error getting the tags from the database, then false
- if any of the tags do not have a UID that matches one that's in the Db, then false
- if all of the tags have a UID that matches one that's in the Db, then true
func AutoMigrateTables ¶
func AutoMigrateTables() error
func CreateForeignKeys ¶
func CreateForeignKeys() error
func DeleteItem ¶
func DeleteOrphanedItems ¶
func DeleteOrphanedItems(itemObj interface{}, relationID string)
itemObj needs to be a pointer relationID should be something like "node_id"
func DropTables ¶
func DropTables() error
func GetAuthorizationStatus ¶
func GetAuthorizationStatus(req events.APIGatewayProxyRequest, permissionType string, objectTags []domain.Tag) (int, string)
GetAuthorizationStatus returns 0, nil for users that are authorized to use the object
func GetCountryByCode ¶
func GetLatestVersion ¶
func GetLatestVersion() (domain.Version, error)
GetLatestVersion iterates through version in Db to return only the latest version
func GetNodeByMacAddr ¶
func GetReportingEvents ¶
func GetSnapshotsForRange ¶
func GetTaskLogForRange ¶
func GetUserFromRequest ¶
func GetUserFromRequest(req events.APIGatewayProxyRequest) (domain.User, error)
func ListMIANodes ¶
func ListNamedServersByType ¶
func PutItemWithAssociations ¶
func PutItemWithAssociations(itemObj interface{}, replacements []domain.AssociationReplacements) error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.