config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package config provides a configuration for the API

Index

Constants

View Source
const (
	DatabaseDefaultTxTimeout = 15 * time.Second
	EnvironmentDevelopment   = "development"
	EnvironmentKey           = "API_ENVIRONMENT"
	EnvironmentProduction    = "production"
	EnvironmentStaging       = "staging"
	HealthRequestPath        = "health"
	HTTPRequestReadTimeout   = 15 * time.Second
	HTTPRequestWriteTimeout  = 15 * time.Second
	ServiceModeAPI           = "api"
)

Config constants used for optimization and value testing

Variables

View Source
var Values appConfig

Values global configuration (config.Values)

Functions

func GetCurrentDir added in v0.0.3

func GetCurrentDir() string

GetCurrentDir gets the current directory for all operating systems

func Load

func Load() (err error)

Load all environment variables

Types

type SchedulerConfig

type SchedulerConfig struct {
	CronApp *cron.Cron
}

SchedulerConfig is our cron task wrapper

func (SchedulerConfig) AddJob

func (s SchedulerConfig) AddJob(name, spec string, cmd func()) (entryID cron.EntryID, err error)

AddJob adds a new cron job and returns the entry ID

func (SchedulerConfig) RemoveJob added in v0.1.3

func (s SchedulerConfig) RemoveJob(entryID cron.EntryID) (err error)

RemoveJob will remove a cron job by entryID (int)

Jump to

Keyboard shortcuts

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