cacheconf

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigTagName = "config"

ConfigTagName - Defines the tag name to permit CacheConfig stores your configurations

Variables

This section is empty.

Functions

func Debug

func Debug() bool

Debug - Returns if application is in debug

func GetCurrentConfig

func GetCurrentConfig() string

GetCurrentConfig - Returns the current config

func LoadEnvConfig

func LoadEnvConfig(c CacheConfigInterface)

LoadEnvConfig - Try to init the CacheConfigInterface using DefaultCacheConfig for default config fields and the custom CacheConfig passed as CacheConfigInterface, requires that "c" is a pointer to your custom CacheConfig

Types

type CacheConfigInterface

type CacheConfigInterface interface {
	GetDefaultCacheConfig() CacheConfigInterface
}

CacheConfigInterface - Interface to implements CacheConfig No methods, all you need is to define the tag "config" for your Custom CacheConfig

type DefaultCacheConfig

type DefaultCacheConfig struct {
	AppName          string `config:"APP_NAME"`
	Debug            bool   `config:"DEBUG"`
	SQLDriver        string `config:"SQL_DRIVER"`
	StringConnection string `config:"STRING_CONNECTION"`
	AppPort          string `config:"APP_PORT"`
}

DefaultCacheConfig - Defines the standard configuration

func (*DefaultCacheConfig) GetDefaultCacheConfig

func (d *DefaultCacheConfig) GetDefaultCacheConfig() CacheConfigInterface

GetDefaultCacheConfig - Return the instance of CacheConfigInterface

Jump to

Keyboard shortcuts

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