base

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package base defines the names and variables that have global scope throughout which can be used in other subpackages

Index

Constants

View Source
const APIVersion = "v1"

APIVersion sets the version of API in paths

View Source
const CEEMSDBName = "ceems.db"

CEEMSDBName is the name of CEEMS DB file

View Source
const CEEMSServerAppName = "ceems_api_server"

CEEMSServerAppName is kingpin app name

Variables

View Source
var (
	UnitsDBTableName      = models.Unit{}.TableName()
	UsageDBTableName      = models.Usage{}.TableName()
	ProjectsDBTableName   = models.Project{}.TableName()
	UsersDBTableName      = models.User{}.TableName()
	AdminUsersDBTableName = models.AdminUsers{}.TableName()
)

DB table names

View Source
var (
	UnitsDBTableColNames      = models.Unit{}.TagNames("sql")
	UsageDBTableColNames      = models.Usage{}.TagNames("sql")
	ProjectsDBTableColNames   = models.Project{}.TagNames("sql")
	UsersDBTableColNames      = models.User{}.TagNames("sql")
	AdminUsersDBTableColNames = models.AdminUsers{}.TagNames("sql")
)

Slice of all field names of Unit struct

View Source
var (
	UnitsDBTableStructFieldColNameMap      = models.Unit{}.TagMap("", "sql")
	UsageDBTableStructFieldColNameMap      = models.Usage{}.TagMap("", "sql")
	ProjectsDBTableStructFieldColNameMap   = models.Project{}.TagMap("", "sql")
	UsersDBTableStructFieldColNameMap      = models.User{}.TagMap("", "sql")
	AdminUsersDBTableStructFieldColNameMap = models.AdminUsers{}.TagMap("", "sql")
)

Map of struct field name to DB column name

View Source
var (
	UnitsDBTableColTypeMap      = models.Unit{}.TagMap("sql", "sqlitetype")
	UsageDBTableColTypeMap      = models.Usage{}.TagMap("sql", "sqlitetype")
	ProjectsDBTableColTypeMap   = models.Project{}.TagMap("sql", "sqlitetype")
	UsersDBTableColTypeMap      = models.User{}.TagMap("sql", "sqlitetype")
	AdminUsersDBTableColTypeMap = models.AdminUsers{}.TagMap("sql", "sqlitetype")
)

Map of DB column names to DB column type

View Source
var CEEMSServerApp = *kingpin.New(
	CEEMSServerAppName,
	"API server for reporting usage statistics for batchjobs/VMs/Pods.",
)

CEEMSServerApp is kinpin app

View Source
var (
	ConfigFilePath string
)

CLI args with global scope

View Source
var DatetimeLayout = fmt.Sprintf("%sT%s", time.DateOnly, time.TimeOnly)

DatetimeLayout to be used in the package

View Source
var (
	InvalidIDRegex = regexp.MustCompile("[^a-zA-Z0-9-_]")
)

Cluster and Updater ID valid regex

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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