util

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Flags flags
View Source
var Logger *log_level.Logger

Functions

func GetManagerID added in v0.3.0

func GetManagerID(pth, val string) (string, error)

func InitLogger

func InitLogger(config srv_base.LoggerConfig) (out *os.File, err error)

func NewDB added in v0.6.0

func NewDB(addr string, port uint, user string, pw string, name string) (*sql.DB, error)

func ParseFlags

func ParseFlags()

Types

type Config

type Config struct {
	ServerPort         uint                     `json:"server_port" env_var:"SERVER_PORT"`
	ModStorageHandler  ModStorageHandlerConfig  `json:"module_storage_handler" env_var:"MSH_CONFIG"`
	ModTransferHandler ModTransferHandlerConfig `json:"module_transfer_handler" env_var:"MTH_CONFIG"`
	ModStagingHandler  ModStagingHandlerConfig  `json:"module_staging_handler" env_var:"MSH_CONFIG"`
	DepHandler         DepHandlerConfig         `json:"deployment_handler" env_var:"DH_CONFIG"`
	Logger             srv_base.LoggerConfig    `json:"logger" env_var:"LOGGER_CONFIG"`
	ConfigDefsPath     string                   `json:"config_defs_path" env_var:"CONFIG_DEFS_PATH"`
	Database           DatabaseConfig           `json:"database" env_var:"DATABASE_CONFIG"`
	HttpClient         HttpClientConfig         `json:"http_client" env_var:"HTTP_CLIENT_CONFIG"`
	Jobs               JobsConfig               `json:"jobs" env_var:"JOBS_CONFIG"`
	ManagerIDPath      string                   `json:"manager_id_path" env_var:"MANAGER_ID_PATH"`
}

func NewConfig

func NewConfig(path string) (*Config, error)

type DatabaseConfig

type DatabaseConfig struct {
	Host       string `json:"host" env_var:"DB_HOST"`
	Port       uint   `json:"port" env_var:"DB_PORT"`
	User       string `json:"user" env_var:"DB_USER"`
	Passwd     string `json:"passwd" env_var:"DB_PASSWD"`
	Name       string `json:"name" env_var:"DB_NAME"`
	Timeout    int64  `json:"timeout" env_var:"DB_TIMEOUT"`
	SchemaPath string `json:"schema_path" env_var:"DB_SCHEMA_PATH"`
}

type DepHandlerConfig

type DepHandlerConfig struct {
	WorkdirPath string `json:"workdir_path" env_var:"DH_WORKDIR_PATH"`
	HostDepPath string `json:"host_dep_path" env_var:"DH_HOST_DEP_PATH"`
	HostSecPath string `json:"host_sec_path" env_var:"DH_HOST_SEC_PATH"`
	ModuleNet   string `json:"module_net" env_var:"DH_MODULE_NET"`
}

type HttpClientConfig

type HttpClientConfig struct {
	CewBaseUrl string `json:"cew_base_url" env_var:"CEW_BASE_URL"`
	HmBaseUrl  string `json:"hm_base_url" env_var:"HM_BASE_URL"`
	SmBaseUrl  string `json:"sm_base_url" env_var:"SM_BASE_URL"`
	Timeout    int64  `json:"timeout" env_var:"HTTP_TIMEOUT"`
}

type JobsConfig

type JobsConfig struct {
	BufferSize  int   `json:"buffer_size" env_var:"JOBS_BUFFER_SIZE"`
	MaxNumber   int   `json:"max_number" env_var:"JOBS_MAX_NUMBER"`
	CCHInterval int   `json:"cch_interval" env_var:"JOBS_CCH_INTERVAL"`
	JHInterval  int   `json:"jh_interval" env_var:"JOBS_JH_INTERVAL"`
	MaxAge      int64 `json:"max_age" env_var:"JOBS_MAX_AGE"`
}

type ModStagingHandlerConfig

type ModStagingHandlerConfig struct {
	WorkdirPath string `json:"workdir_path" env_var:"MSH_WORKDIR_PATH"`
}

type ModStorageHandlerConfig

type ModStorageHandlerConfig struct {
	WorkdirPath string `json:"workdir_path" env_var:"MSH_WORKDIR_PATH"`
}

type ModTransferHandlerConfig

type ModTransferHandlerConfig struct {
	WorkdirPath string `json:"workdir_path" env_var:"MTH_WORKDIR_PATH"`
	Timeout     int64  `json:"timeout" env_var:"MTH_TIMEOUT"`
}

type RWMutex

type RWMutex struct {
	// contains filtered or unexported fields
}

func (*RWMutex) RUnlock

func (m *RWMutex) RUnlock()

func (*RWMutex) TryLock

func (m *RWMutex) TryLock(reason string) error

func (*RWMutex) TryRLock

func (m *RWMutex) TryRLock() error

func (*RWMutex) Unlock

func (m *RWMutex) Unlock()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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