base

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 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 (
	GrafanaUserHeader       = "X-Grafana-User"
	OAuth2ProxyUserHeader   = "X-Auth-Request-User"
	AuthenticatedUserHeader = "X-Authenticated-User"
	LoggedUserHeader        = "X-Ceems-Logged-User"
	AdminUserHeader         = "X-Ceems-Admin-User"
	ClusterIDHeader         = "X-Ceems-Cluster-Id"
)

Headers.

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.

View Source
const CEEMSServiceAccount = "ceems-int-svc"

CEEMSServiceAccount is the internal service account that has admin status.

View Source
const ServiceAccountUser = "svc"

Username to be used for service account users.

Variables

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

DB table names.

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

Slice of field names of all tables This slice will not contain the DB columns that are ignored in the query.

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.User{}.TagMap("", "sql")
)

Map of struct field name to DB column name.

View Source
var (
	ConfigFilePath          string
	ConfigFileExpandEnvVars bool
)

CLI args with global scope.

View Source
var (
	AppReadPaths      []string
	AppReadWritePaths []string
)

CEEMS API server read and read write paths.

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

CEEMSServerApp is kinpin app.

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

DatetimeLayout to be used in the package.

View Source
var DatetimezoneLayout = DatetimeLayout + "-0700"

DatetimezoneLayout 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