util

package
v0.0.0-...-56b22ea Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const HeurekaFiglet = `` /* 191-byte string literal not displayed */

Variables

This section is empty.

Functions

func ConvertStrToIntSlice

func ConvertStrToIntSlice(slice []*string) ([]*int64, error)

func FindMaxBy

func FindMaxBy[E any, T constraints.Ordered](s []E, fn func(val E) (T, error)) (*E, error)

FindMaxBy is getting a Maximum Value from a given slice using a callback function that is returning the value of type constraints.Ordered used to do the comparison

Types

type Config

type Config struct {
	Port string `envconfig:"SERVER_PORT" default:":80" json:"-"`
	//Regions            []string `envconfig:"REGIONS" required:"true" json:"regions"`
	//CloudAdminUsername string   `envconfig:"OS_USERNAME" required:"true" json:"cloudAdminUser"`
	//CloudAdminPassword string   `envconfig:"OS_PASSWORD" required:"true" json:"-"`
	DBAddress            string `envconfig:"DB_ADDRESS" required:"true" json:"dbAddress"`
	DBUser               string `envconfig:"DB_USER" required:"true" json:"dbUser"`
	DBPassword           string `envconfig:"DB_PASSWORD" required:"true" json:"-"`
	DBRootPassword       string `envconfig:"DB_ROOT_PASSWORD" required:"true" json:"-"`
	DBPort               string `envconfig:"DB_PORT" required:"true" json:"dbPort"`
	DBName               string `envconfig:"DB_NAME" required:"true" json:"dbDbName"`
	DBSchema             string `envconfig:"DB_SCHEMA" required:"true" json:"dbSchema"`
	DBMaxIdleConnections int    `envconfig:"DB_MAX_IDLE_CONNECTIONS" default:"10" json:"dBMaxIdleConnections"`
	DBMaxOpenConnections int    `envconfig:"DB_MAX_OPEN_CONNECTIONS" default:"100" json:"dbMaxOpenConnections"`
	//VasApiAddress      string   `envconfig:"VAS_API_ADDRESS" required:"true" json:"vasApiAddress"`
	//VasApiToken        string   `envconfig:"VAS_API_TOKEN" required:"true" json:"-"`
	//NvdApiToken        string   `envconfig:"NVD_API_TOKEN" required:"true" json:"-"`
	//OidcClientId       string   `envconfig:"OIDC_CLIENT_ID" required:"true" json:"-"`
	//OidcUrl            string   `envconfig:"OIDC_URL" required:"true" json:"-"`
	//Environment        string   `envconfig:"ENVIRONMENT" required:"true" json:"environment"`
	//// https://pkg.go.dev/github.com/robfig/cron#hdr-Predefined_schedules
	//DiscoverySchedule string `envconfig:"DISOVERY_SCHEDULE" default:"0 0 0 * * *" json:"discoverySchedule"`
	SeedMode              bool   `envconfig:"SEED_MODE" required:"false" default:"false" json:"seedMode"`
	AuthType              string `envconfig:"AUTH_TYPE" required:"false" json:"-" default:"none"`
	AuthTokenSecret       string `envconfig:"AUTH_TOKEN_SECRET" required:"false" json:"-"`
	DefaultIssuePriority  int64  `envconfig:"DEFAULT_ISSUE_PRIORITY" default:"100" json:"defaultIssuePriority"`
	DefaultRepositoryName string `envconfig:"DEFAULT_REPOSITORY_NAME" default:"nvd" json:"defaultRepositoryName"`
}

func (*Config) ConfigToConsole

func (c *Config) ConfigToConsole()

Jump to

Keyboard shortcuts

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