sty_shared

package
v2024.4.9 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 7 Imported by: 5

Documentation

Overview

Package sty_shared

This is the STY-Holdings shared services

NOTES:

None

COPYRIGHT & WARRANTY:

Copyright (c) 2022 STY-Holdings, inc
All rights reserved.

This software is the confidential and proprietary information of STY-Holdings, Inc.
Use is subject to license terms.

Unauthorized copying of this file, via any medium is strictly prohibited.

Proprietary and confidential

Written by <Replace with FULL_NAME> / syacko
STY-Holdings, Inc.
support@sty-holdings.com
www.sty-holdings.com

01-2024
USA

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Package sty_shared

General description of the purpose of the go file.

RESTRICTIONS:

AWS functions:
* Program must have access to a .awsServices/credentials file in the default location.
* This will only access system parameters that start with '/sote' (ROOTPATH).
* {Enter other restrictions here for AWS

{Other catagories of restrictions}
* {List of restrictions for the catagory

NOTES:

{Enter any additional notes that you believe will help the next developer.}

COPYRIGHT:

Copyright 2022
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Index

Constants

View Source
const (
	DEFAULT_LOG_DIRECTORY                    = "/var/log/natsSerices-connect"
	DEFAULT_MAX_THREADS                      = 1
	DEFAULT_PID_DIRECTORY                    = "/var/run/natsSerices-connect"
	DEFAULT_SKELETON_CONFIG_FQD              = "/Users/syacko/workspace/sty-holdings/GriesPikeThomp/shared-services/src/coreConfiguration/"
	DEFAULT_SKELETON_CONFIG_FILENAME         = "skeleton-config-file.json"
	DEFAULT_SKELETON_CONFIG_NOTE_FILENAME    = "skeleton-config-file.txt"
	DEFAULT_INVALID_SKELETON_CONFIG_FILENAME = "invalid-skeleton-config-file.json"
	DEFAULT_UNREADABLE_CONFIG_FILENAME       = "unreadable-skeleton-config-file.json"
	THREAD_CAP                               = 25 // This is set so system performance can be controlled. Update this as more is learned about the system.
)

Variables

This section is empty.

Functions

func GenerateConfigFileSkeleton

func GenerateConfigFileSkeleton(serverName, SkeletonConfigFQD string) (errorInfo pi.ErrorInfo)

GenerateConfigFileSkeleton will output to the console a skeleton file with notes.

Customer Messages: None
Errors: ErrConfigFileMissing
Verifications: None

func GetConfigFile added in v2024.4.8

func GetConfigFile(
	configFileFQN string,
	configPtr interface{},
) (
	errorInfo pi.ErrorInfo,
)

GetConfigFile - handles any configuration file.

Customer Messages: None
Errors: ReadConfigFile returned error, ErrJSONInvalid
Verifications: None

func ReadConfigFile

func ReadConfigFile(configFileFQN string) (
	configData []byte,
	errorInfo pi.ErrorInfo,
)

ReadConfigFile opens the provide file, unmarshal the file and returns the Configuration object.

Customer Messages: None
Errors: ErrConfigFileMissing, ErrJSONInvalid
Verifications: None

func ValidateConfiguration

func ValidateConfiguration(config BaseConfiguration) (errorInfo pi.ErrorInfo)

ValidateConfiguration - checks the values in the configuration file are valid. ValidateConfiguration doesn't test if the configuration file exists, readable, or parsable. Defaults for LogDirectory, MaxThreads, and PIDDirectory are '/var/log/natsSerices-connect', 1, and '/var/run/natsSerices-connect', respectively.

Customer Messages: None
Errors: ErrEnvironmentInvalid, ErrDirectoryMissing, ErrMaxThreadsInvalid
Verifications: None

Types

type BaseConfigExtensions

type BaseConfigExtensions struct {
	Name           string `json:"name"`
	ConfigFilename string `json:"config_filename"`
}

type BaseConfiguration

type BaseConfiguration struct {
	ConfigFQN         string
	DebugModeOn       bool                   `json:"debug_mode_on"`
	Environment       string                 `json:"environment"`
	LogDirectory      string                 `json:"log_directory"`
	MaxThreads        int                    `json:"max_threads"`
	PIDDirectory      string                 `json:"pid_directory"`
	Extensions        []BaseConfigExtensions `json:"load_extensions"`
	SkeletonConfigFQD string                 `json:"skeleton_config_fqd"`
}

Configuration is a generic config file structure for application servers.

func ProcessBaseConfigFile

func ProcessBaseConfigFile(configFileFQN string) (
	config BaseConfiguration,
	errorInfo pi.ErrorInfo,
)

ProcessBaseConfigFile - handles the base configuration file.

Customer Messages: None
Errors: errors returned from ReadConfigFile, ErrJSONInvalid
Verifications: None

Jump to

Keyboard shortcuts

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