config

package
v0.0.0-...-9b07614 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: MulanPSL-2.0 Imports: 19 Imported by: 0

Documentation

Overview

config package for ras.

Index

Constants

View Source
const (

	// RasVersion means ras version
	RasVersion = "2.0.2"

	// AutoStrategy means mgr strategy is auto
	AutoStrategy = "auto"
	// ManualStrategy means mgr strategy is manual
	ManualStrategy = "manual"
)

Variables

View Source
var (

	// VersionFlag means version flag
	VersionFlag *bool = nil

	// TokenFlag means token flag
	TokenFlag *bool = nil
)

Functions

func GetAuthKeyFile

func GetAuthKeyFile() string

GetAuthKeyFile returns the auth token key configuration.

func GetDBHost

func GetDBHost() string

GetDBHost returns the database host configuration.

func GetDBName

func GetDBName() string

GetDBName returns the database name configuration.

func GetDBPassword

func GetDBPassword() string

GetDBPassword returns the database user password configuration.

func GetDBPort

func GetDBPort() int

GetDBPort returns the database port configuration.

func GetDBUser

func GetDBUser() string

GetDBUser returns the database user name configuration.

func GetDigestAlgorithm

func GetDigestAlgorithm() string

GetDigestAlgorithm returns digest algorithm configuration.

func GetExtractRules

func GetExtractRules() typdefs.ExtractRules

GetExtractRules returns the ras extract rules configuration.

func GetHBDuration

func GetHBDuration() time.Duration

GetHBDuration returns heart beat duration configuration.

func GetHttpsKeyCert

func GetHttpsKeyCert() *x509.Certificate

GetHttpsKeyCert returns the https key certificate configuration.

func GetHttpsKeyCertFile

func GetHttpsKeyCertFile() string

GetHttpsKeyCertFile returns the HttpsKeyCertFile configuration.

func GetHttpsPort

func GetHttpsPort() string

GetHttpsPort returns the ras restful api interface ip:port configuration.

func GetHttpsPrivateKey

func GetHttpsPrivateKey() crypto.PrivateKey

GetHttpsPrivateKey returns the https private key configuration.

func GetHttpsPrivateKeyFile

func GetHttpsPrivateKeyFile() string

GetHttpsPrivateKeyFile returns the HttpsPrivateKeyFile configuration.

func GetHttpsSwitch

func GetHttpsSwitch() bool

GetHttpsSwitch returns the ras restful api interface protocol(http or https) configuration.

func GetIP

func GetIP() string

GetIP returns the ras server ip address.

func GetIsAllUpdate

func GetIsAllUpdate() *bool

GetIsAllUpdate returns the ras isallupdate configuration.

func GetLogFile

func GetLogFile() string

GetLogFile returns the logger path configuration.

func GetLoggerMode

func GetLoggerMode() *bool

GetLoggerMode returns ras log file configuration.

func GetMgrStrategy

func GetMgrStrategy() string

GetMgrStrategy returns the ras mgrStrategy configuration.

func GetOnlineDuration

func GetOnlineDuration() time.Duration

GetOnlineDuration returns client online expire duration configuration.

func GetPcaKeyCert

func GetPcaKeyCert() *x509.Certificate

GetPcaKeyCert returns the pca key certificate configuration.

func GetPcaPrivateKey

func GetPcaPrivateKey() crypto.PrivateKey

GetPcaPrivateKey returns the pca private key configuration.

func GetRestPort

func GetRestPort() string

GetRestPort returns the ras restful api interface ip:port configuration.

func GetRimRootCert

func GetRimRootCert() *x509.Certificate

GetRimRootCert returns the root key certificate configuration for RIM signature check.

func GetRootKeyCert

func GetRootKeyCert() *x509.Certificate

GetRootKeyCert returns the root key certificate configuration.

func GetRootPrivateKey

func GetRootPrivateKey() crypto.PrivateKey

GetRootPrivateKey returns the root private key configuration.

func GetServerPort

func GetServerPort() string

GetServerPort returns the ras service ip:port configuration.

func GetTaInputs

func GetTaInputs() map[string]typdefs.TaReportInput

GetTaInputs return ta inputs.

func GetTaVerifyType

func GetTaVerifyType() int

GetTaVerifyType returns ta verify type configuration.

func GetTestMode

func GetTestMode() bool

GetTestMode returns the test mode configuration.

func GetTrustDuration

func GetTrustDuration() time.Duration

GetTrustDuration returns trust report expire duration configuration.

func HandleFlags

func HandleFlags()

HandleFlags handles the command flags.

func InitFlags

func InitFlags()

InitFlags inits the ras server command flags.

func LoadConfigs

func LoadConfigs()

LoadConfigs searches and loads config from config.yaml file.

func SaveConfigs

func SaveConfigs()

SaveConfigs saves all config variables to the config.yaml file.

func SetAuthKeyFile

func SetAuthKeyFile(filename string)

SetAuthKeyFile sets the auth token key configuration.

func SetDBHost

func SetDBHost(host string)

SetDBHost sets the database host configuration.

func SetDBName

func SetDBName(dbName string)

SetDBName sets the database name configuration.

func SetDBPassword

func SetDBPassword(password string)

SetDBPassword sets the database user password configuration.

func SetDBPort

func SetDBPort(port int)

SetDBPort sets the database port configuration.

func SetDBUser

func SetDBUser(user string)

SetDBUser sets the database user name configuration.

func SetDigestAlgorithm

func SetDigestAlgorithm(s string)

SetDigestAlgorithm sets digest algorithm configuration.

func SetExtractRules

func SetExtractRules(val string)

SetExtractRules sets the ras extract rules configuration.

func SetHBDuration

func SetHBDuration(v time.Duration)

SetHBDuration sets heart beat duration configuration.

func SetHttpsPort

func SetHttpsPort(s string)

SetHttpsPort sets the ras restful api interface ip:port configuration.

func SetHttpsSwitch

func SetHttpsSwitch(p string)

SetHttpsSwitch sets the ras restful api interface protocol(http or https) configuration.

func SetIsAllUpdate

func SetIsAllUpdate(b bool)

SetIsAllUpdate sets the ras isallupdate configuration.

func SetLoggerMode

func SetLoggerMode(testMode bool)

SetLoggerMode sets ras log file configuration.

func SetMgrStrategy

func SetMgrStrategy(s string)

SetMgrStrategy sets the ras mgrStrategy configuration.

func SetOnlineDuration

func SetOnlineDuration(v time.Duration)

SetOnlineDuration sets client online expire duration configuration.

func SetRestPort

func SetRestPort(s string)

SetRestPort sets the ras restful api interface ip:port configuration.

func SetServerPort

func SetServerPort(s string)

SetServerPort sets the ras service ip:port configuration.

func SetTaVerifyType

func SetTaVerifyType(vtype int)

vtype shuold be 1/2/3 SetTaVerifyType sets ta verify type configuration.

func SetTestMode

func SetTestMode(m bool)

SetTestMode sets the test mode configuration.

func SetTrustDuration

func SetTrustDuration(v time.Duration)

SetTrustDuration sets trust report expire duration configuration.

Types

This section is empty.

Jump to

Keyboard shortcuts

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